Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit c572362

Browse files
committed
fix: adding snapshot support
1 parent 2074f7a commit c572362

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+448
-651
lines changed

cypress.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
2-
"experimentalComponentTesting": true,
32
"componentFolder": "packages/",
4-
"pluginsFile": "./plugins.js",
5-
"testFiles": "**/*.test.*",
6-
"supportFile": "packages/tests/support.ts"
3+
"pluginsFile": "./packages/tests/plugins.js",
4+
"testFiles": "**/*.cy.*",
5+
"supportFile": "packages/tests/support.tsx",
6+
"ignoreTestFiles": "**/*.snap",
7+
"video": false,
8+
"fixturesFolder": false,
9+
"reporter": "spec"
710
}

cypress/fixtures/example.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

cypress/support/commands.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

cypress/support/index.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

package.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
"build": "lerna run build --no-private --stream",
1616
"dev": "NODE_ENV=development vite serve playground --config ./vite.config.ts",
1717
"playground:build": "yarn install && yarn build && yarn bootstrap && NODE_ENV=production vite build playground --config ./vite.config.ts",
18-
"cypress:open:ct": "cypress open-ct",
18+
"cy:open": "cypress open-ct",
19+
"cy:run": "cypress run-ct --quiet",
20+
"test:unit": "jest",
21+
"test:component": "cy:run",
22+
"test": "jest && yarn cy:run",
1923
"lint": "eslint '*/**/*.{js,ts,tsx}' --quiet --fix",
2024
"docs:dev": "vitepress dev docs",
2125
"docs:build": "vitepress build docs",
@@ -35,8 +39,7 @@
3539
"c-spinner": "yarn workspace @chakra-ui/c-spinner",
3640
"c-badge": "yarn workspace @chakra-ui/c-badge",
3741
"c-portal": "yarn workspace @chakra-ui/c-portal",
38-
"c-popper": "yarn workspace @chakra-ui/c-popper",
39-
"cy": "node ../../github/cypress/scripts/cypress.js open-ct"
42+
"c-popper": "yarn workspace @chakra-ui/c-popper"
4043
},
4144
"license": "MIT",
4245
"private": true,
@@ -49,6 +52,7 @@
4952
"@commitlint/config-conventional": "^11.0.0",
5053
"@cypress/vite-dev-server": "^1.1.0",
5154
"@cypress/vue": "^3.0.0-alpha.4",
55+
"@cypress/snapshot": "2.1.7",
5256
"@testing-library/jest-dom": "^5.11.9",
5357
"@testing-library/user-event": "^12.6.2",
5458
"@testing-library/vue": "^6.3.4",
@@ -70,7 +74,7 @@
7074
"concurrently": "^5.3.0",
7175
"consola": "^2.15.0",
7276
"cross-env": "^7.0.2",
73-
"cypress": "https://cdn.cypress.io/beta/npm/6.9.0/circle-develop-3700fe7271b016f8a89c5a7a4c40d0af62155b45/cypress.tgz",
77+
"cypress": "https://cdn.cypress.io/beta/npm/6.9.0/circle-7.0-release-e4f5bb7181aea3046563f630289a0c4684fcb1d9/cypress.tgz",
7478
"esbuild-jest": "^0.4.0",
7579
"eslint": "^7.0.0",
7680
"eslint-config-prettier": "^6.12.0",
@@ -97,7 +101,7 @@
97101
"ts-jest": "^26.5.0",
98102
"ts-node": "^9.0.0",
99103
"typescript": "^4.1.2",
100-
"vite": "2.1.2",
104+
"vite": "^2.1.5",
101105
"vite-plugin-components": "^0.6.6",
102106
"vite-plugin-pages": "^0.3.0",
103107
"vitepress": "^0.12.0",

packages/c-accordion/tests/__snapshots__/c-accordion.test.ts.snap

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/c-accordion/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"extends": "../../tsconfig.json",
33
"include": ["src"]
4-
}
4+
}

packages/c-alert/tests/__snapshots__/c-alert.test.ts.snap

Lines changed: 0 additions & 71 deletions
This file was deleted.

packages/c-alert/tests/c-alert.test.tsx renamed to packages/c-alert/tests/c-alert.cy.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,21 @@ describe('Alert Examples', () => {
1212

1313
it('contains the correct role', () => {
1414
cy.mount(Examples.BaseAlert.default)
15+
.then(() => {})
1516
.get('[role=alert]')
1617
.should('exist')
1718
})
1819

1920
it.only('renders its children', () => {
20-
debugger;
2121
cy.mount(
2222
<CAlert data-testid="alert" variant="left-accent" status="info" mb="3">
2323
<CAlertIcon mr="2" />
2424
<CAlertTitle> Info alert </CAlertTitle>
2525
<CAlertDescription> Something just happened </CAlertDescription>
2626
</CAlert>
27-
).get('[data-testid=alert]')
27+
)
28+
.get('[data-testid=alert]')
2829
.should('contain', 'Info alert')
2930
.and('contain', 'Something just happened')
3031
.and('descendants', 'svg')
31-
})
32+
})

0 commit comments

Comments
 (0)