2023-02-20 18:17:38 +00:00
|
|
|
/* eslint-env mocha */
|
|
|
|
/* global cy */
|
2023-03-23 16:07:42 +00:00
|
|
|
describe("@datashard/snapshot", () => {
|
2023-02-20 18:17:38 +00:00
|
|
|
context("simple types", () => {
|
|
|
|
it("works with objects", () => {
|
2024-01-25 16:30:16 +00:00
|
|
|
cy.wrap({
|
|
|
|
"foo": "bar",
|
|
|
|
"Fizzy Drink": "Pop"
|
|
|
|
}).snapshot(
|
|
|
|
// "Filename", {
|
|
|
|
// snapshotPath: "asdasd"
|
|
|
|
// }
|
|
|
|
);
|
2023-02-20 18:17:38 +00:00
|
|
|
|
2024-01-25 16:30:16 +00:00
|
|
|
// cypress/fixtures/@datashard-snapshot/simple-types/works-with-objects/asdjskadhasj.json
|
2023-02-20 18:17:38 +00:00
|
|
|
});
|
|
|
|
|
2024-01-25 16:30:16 +00:00
|
|
|
// it("works with numbers", () => {
|
|
|
|
// cy.wrap(42).snapshot({
|
|
|
|
// snapshotPath: "cypress/fixtures/snapshots",
|
|
|
|
// snapshotName: "Numbers",
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
|
|
|
|
// it("works with strings", () => {
|
|
|
|
// cy.wrap("foo-bar").snapshot({
|
|
|
|
// snapshotPath: "cypress/fixtures/snapshots",
|
|
|
|
// snapshotName: "Strings",
|
|
|
|
// });
|
|
|
|
// });
|
2023-02-20 18:17:38 +00:00
|
|
|
|
2024-01-25 16:30:16 +00:00
|
|
|
// it(
|
|
|
|
// "works with arrays",
|
|
|
|
// {
|
|
|
|
// env: {
|
|
|
|
// SNAPSHOT_UPDATE: true,
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
// () => {
|
|
|
|
// cy.wrap([1, 2, 3, 4]).snapshot({
|
|
|
|
// snapshotPath: "cypress/fixtures/snapshots",
|
|
|
|
// snapshotName: "Arrays",
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// );
|
|
|
|
// it('works with more "complicated" Objects', () => {
|
|
|
|
// cy.fixture("Complex").snapshot({
|
|
|
|
// snapshotPath: 'cypress/fixtures/snapshots',
|
|
|
|
// snapshotName: "Complex"
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
// it.only("works based on fixtures", () => {
|
|
|
|
// cy
|
|
|
|
// .wrap({
|
|
|
|
// "jsonapi": {
|
|
|
|
// "version": "2.0"
|
|
|
|
// },
|
|
|
|
// "included": [
|
|
|
|
// {
|
|
|
|
// "type": "users",
|
|
|
|
// "id": "2",
|
|
|
|
// "attributes": {
|
|
|
|
// "name": "Test"
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// ]
|
|
|
|
// })
|
|
|
|
// .snapshot({
|
|
|
|
// snapshotFixture: "generated",
|
|
|
|
// // snapshotPath: "cypress/fixtures/snapshots",
|
|
|
|
// // snapshotName: "generated",
|
|
|
|
// });
|
|
|
|
// });
|
2023-02-20 18:17:38 +00:00
|
|
|
});
|
|
|
|
});
|