Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
219 changes: 219 additions & 0 deletions tests/__snapshots__/jest_custom_matchers.test.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`toBeCancelledBecause matches cancelled dispatch reasons 1`] = `
"
The command should have been cancelled:
Expected: ["WillRemoveExistingMerge"]
Received: ["CancelledForUnknownReason"]
"
`;

exports[`toBeSuccessfullyDispatched can use not.toBeSuccessfullyDispatched 1`] = `"The command should not have been successfully dispatched"`;

exports[`toBeSuccessfullyDispatched matches successful dispatch results 1`] = `
"
The command should have been successfully dispatched:
CancelledReasons: ["CancelledForUnknownReason"]
"
`;

exports[`toExport can use not.toExport 1`] = `
"Diff: - Not expected - 1
+ Received + 1

@@ -3,11 +3,11 @@
 "customTableStyles": Object {},
 "formats": Object {},
 "namedRanges": Object {},
 "pivotNextId": 1,
 "pivots": Object {},
- "revisionId": "random-id",
+ "revisionId": "mock-uuidv4-2",
 "settings": Object {
 "locale": Object {
 "code": "en_US",
 "dateFormat": "m/d/yyyy",
 "decimalSeparator": ".","
`;

exports[`toExport ignores the revision id and compares exported data 1`] = `
"Diff: - Expected - 2
+ Received + 4

@@ -3,11 +3,11 @@
 "customTableStyles": Object {},
 "formats": Object {},
 "namedRanges": Object {},
 "pivotNextId": 1,
 "pivots": Object {},
- "revisionId": "START_REVISION",
+ "revisionId": "mock-uuidv4-2",
 "settings": Object {
 "locale": Object {
 "code": "en_US",
 "dateFormat": "m/d/yyyy",
 "decimalSeparator": ".",
@@ -20,11 +20,13 @@
 },
 "sheets": Array [
 Object {
 "areGridLinesVisible": true,
 "borders": Object {},
- "cells": Object {},
+ "cells": Object {
+ "A1": "42",
+ },
 "colNumber": 26,
 "color": undefined,
 "cols": Object {},
 "conditionalFormats": Array [],
 "dataValidationRules": Array [],"
`;

exports[`toHaveAttribute can use not.toHaveAttribute 1`] = `
"expect(target).not.toHaveAttribute(aria-label, expected);

Unexpected attribute value: "Confirm"
Received value: serializes to the same string"
`;

exports[`toHaveAttribute matches attribute values 1`] = `
"expect(target).toHaveAttribute(aria-label, expected);

Expected attribute value: "Cancel"
Received value: "Confirm""
`;

exports[`toHaveClass can match an element classes 1`] = `
"expect(target).toHaveClass(expected);

Expected class: "gamma"
Received classes: "box alpha beta""
`;

exports[`toHaveClass can use not.toHaveClass 1`] = `
"expect(target).not.toHaveClass(expected);

Unexpected class: "alpha"
Received classes: "box alpha beta""
`;

exports[`toHaveCount can use not.toHaveCount 1`] = `
"expect(".item").not.toHaveCount(expected);

Unexpected count: 2
Received: serializes to the same string"
`;

exports[`toHaveCount counts matching elements 1`] = `
"expect(".item").toHaveCount(expected);

Expected count: 1
Received: 2"
`;

exports[`toHaveStyle can use not.toHaveStyle 1`] = `
"expect(target).not.toHaveStyle(expected);

Unexpected style: {"display": "block"}
Received style: serializes to the same string"
`;

exports[`toHaveStyle compares inline styles and normalizes rgb colors 1`] = `
"expect(target).toHaveStyle(expected);

- Expected style - 1
+ Received style + 1

 Object {
- "color": "#00FF00",
+ "color": "#FF0000",
 }"
`;

exports[`toHaveSynchronizedEvaluation compares evaluated cells across models 1`] = `
"alice and mock-smallUuid-7 are not synchronized:
- alice - 1
+ mock-smallUuid-7 + 1

@@ -1,9 +1,9 @@
 Array [
 Object {
 "sheetId": "Sheet1",
- "value": 2,
+ "value": null,
 "xc": "A1",
 },
 Object {
 "sheetId": "Sheet1",
 "value": null,"
`;

exports[`toHaveSynchronizedExportedData compares exported workbook data 1`] = `
"alice and mock-smallUuid-9 are not synchronized:
- alice - 4
+ mock-smallUuid-9 + 2

@@ -3,11 +3,11 @@
 "customTableStyles": Object {},
 "formats": Object {},
 "namedRanges": Object {},
 "pivotNextId": 1,
 "pivots": Object {},
- "revisionId": "mock-uuidv4-6",
+ "revisionId": "START_REVISION",
 "settings": Object {
 "locale": Object {
 "code": "en_US",
 "dateFormat": "m/d/yyyy",
 "decimalSeparator": ".",
@@ -20,13 +20,11 @@
 },
 "sheets": Array [
 Object {
 "areGridLinesVisible": true,
 "borders": Object {},
- "cells": Object {
- "A1": "42",
- },
+ "cells": Object {},
 "colNumber": 26,
 "color": undefined,
 "cols": Object {},
 "conditionalFormats": Array [],
 "dataValidationRules": Array [],"
`;

exports[`toHaveSynchronizedValue compares the callback result across models 1`] = `
"Alice does not have the expected value:
Received: "2"
Expected: "1""
`;

exports[`toHaveText Can use not.toHaveText 1`] = `
"expect(target).not.toHaveText(expected);

Unexpected text: "Exact text"
Received text: serializes to the same string"
`;

exports[`toHaveText matches exact text content 1`] = `
"expect(target).toHaveText(expected);

Expected text: "Other text"
Received text: "Exact text""
`;

exports[`toHaveValue Can use not.toHaveValue 1`] = `
"expect(target).not.toHaveValue(expected);

Unexpected value: "hello"
Received value: serializes to the same string"
`;

exports[`toHaveValue supports text inputs and checkbox 1`] = `
"expect(target).toHaveValue(expected);

Expected value: "world"
Received value: "hello""
`;
Loading