snapshot/cypress/e2e/1.cy.js

58 lines
1.3 KiB
JavaScript
Raw Normal View History

2023-02-20 18:17:38 +00:00
/* eslint-env mocha */
/* global cy */
describe("@datashard/snapshot", () => {
2023-02-20 18:17:38 +00:00
context("simple types", () => {
it("works with objects", () => {
cy.fixture("File2").snapshot({
snapshotPath: "cypress/snapshots",
snapshotName: "Objects",
});
});
it("works with numbers", () => {
cy.wrap(42).snapshot({
snapshotPath: "cypress/snapshots",
snapshotName: "Numbers",
});
});
it("works with strings", () => {
cy.wrap("foo-bar").snapshot({
snapshotPath: "cypress/snapshots",
snapshotName: "Strings",
});
});
it(
"works with arrays",
{
env: {
SNAPSHOT_UPDATE: true,
},
},
() => {
cy.wrap([1, 2, 3, 4]).snapshot({
snapshotPath: "cypress/snapshots",
snapshotName: "Arrays",
});
}
);
it('works with more "complicated" Objects', () => {
cy.fixture("Complex").snapshot({
snapshotPath: 'cypress/snapshots',
snapshotName: "Complex"
})
})
2023-12-05 09:18:21 +00:00
it('random test string',{
env: {
SNAPSHOT_UPDATE: true,
},
}, () => {
cy.wrap([1, 2, 3, 4]).snapshot({
snapshotPath: 'cypress/snapshots',
snapshotName: "rndmtst"
})
})
2023-02-20 18:17:38 +00:00
});
});