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

Commit 3edefd3

Browse files
committed
wip
1 parent caa6bbd commit 3edefd3

26 files changed

+354
-134
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ lerna-debug.log*
1616
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
1717

1818
# Runtime data
19-
pids
19+
pids
2020
*.pid
2121
*.seed
2222
*.pid.lock

cypress.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"experimentalComponentTesting": true,
3-
"componentFolder": "packages",
3+
"componentFolder": "packages/tests",
44
"pluginsFile": "./plugins.js",
5-
"testFiles": "**/*.test.*"
5+
"testFiles": "**/*.test.*",
6+
"supportFile": "packages/tests/support.ts"
67
}

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
"packages/*"
1010
],
1111
"scripts": {
12-
"postinstall": "yarn bootstrap",
12+
"postinstall": "yarn bootstrap && patch-package",
1313
"bootstrap": "yarn run lerna bootstrap",
1414
"scaffold": "hygen",
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-
"test": "cross-env NODE_ENV=test jest --config jest.config.js",
18+
"cypress:open:ct": "cross-env NODE_ENV=test node ../cypress/core/tr1/cypress/scripts/cypress.js open-ct",
1919
"lint": "eslint '*/**/*.{js,ts,tsx}' --quiet --fix",
2020
"docs:dev": "vitepress dev docs",
2121
"docs:build": "vitepress build docs",
@@ -46,8 +46,8 @@
4646
"@babel/preset-typescript": "^7.12.7",
4747
"@commitlint/cli": "^11.0.0",
4848
"@commitlint/config-conventional": "^11.0.0",
49-
"@cypress/react": "^5.2.0",
5049
"@cypress/vite-dev-server": "^1.1.0",
50+
"@cypress/vue": "^3.0.0-alpha.4",
5151
"@testing-library/jest-dom": "^5.11.9",
5252
"@testing-library/user-event": "^12.6.2",
5353
"@testing-library/vue": "^6.3.4",
@@ -60,6 +60,7 @@
6060
"@vue/babel-plugin-jsx": "^1.0.3",
6161
"@vue/compiler-sfc": "^3.0.5",
6262
"@vue/eslint-config-typescript": "^5.1.0",
63+
"@vue/test-utils": "2.0.0-rc.4",
6364
"@vuedx/typecheck": "^0.4.1",
6465
"@vuedx/typescript-plugin-vue": "^0.4.1",
6566
"axe-core": "^4.1.2",
@@ -69,6 +70,7 @@
6970
"consola": "^2.15.0",
7071
"cross-env": "^7.0.2",
7172
"cypress": "^6.8.0",
73+
"cypress-axe": "^0.12.2",
7274
"esbuild-jest": "^0.4.0",
7375
"eslint": "^7.0.0",
7476
"eslint-config-prettier": "^6.12.0",
@@ -88,13 +90,14 @@
8890
"jest-transform-stub": "^2.0.0",
8991
"lerna": "^3.22.1",
9092
"lint-staged": "^10.5.3",
93+
"patch-package": "6.4.7",
9194
"prettier": "^2.1.2",
9295
"pretty": "^2.0.0",
9396
"recursive-readdir": "^2.2.2",
9497
"ts-jest": "^26.5.0",
9598
"ts-node": "^9.0.0",
9699
"typescript": "^4.1.2",
97-
"vite": "^2.0.0-beta.44",
100+
"vite": "2.1.2",
98101
"vite-plugin-components": "^0.6.6",
99102
"vite-plugin-pages": "^0.3.0",
100103
"vitepress": "^0.12.0",

packages/c-button/tests/c-button.test.ts

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
import { render } from '../../test-utils/src'
1+
// import { render } from '../../test-utils/src'
22
import { CSpinner } from '../src'
3+
import { mount } from '@vue/test-utils/dist/vue-test-utils.esm-browser'
34

4-
it('should render properly', () => {
5-
const { asFragment } = render(CSpinner)
6-
expect(asFragment()).toMatchSnapshot()
5+
describe('try', () => {
6+
it('should render properly', () => {
7+
// mount(CSpinner, { attachTo: '#__cy_root'})
8+
debugger;
9+
console.log(CSpinner)
10+
// throw new Error('feorifhew')
11+
// const { asFragment } = mount(CSpinner)
12+
// expect(asFragment()).toMatchSnapshot()
13+
})
714
})

packages/tests/c-accordion.test.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import CAccordion from '@chakra-ui/c-accordion'
2+
import { h } from 'vue'
3+
4+
it('renders the accordion', () => {
5+
cy.mount(
6+
<CAccordion>
7+
<div>OK</div>
8+
<div>Ah</div>
9+
</CAccordion>)
10+
.checkA11y()
11+
})

packages/tests/c-badge.test.ts

Whitespace-only changes.

packages/tests/c-button-group.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

packages/tests/c-button.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { CButton } from '@chakra-ui/c-button'
2+
import { h } from 'vue'
3+
4+
it('renders a button successfully', () => {
5+
cy.mount(<CButton>An example button</CButton>).checkA11y()
6+
})

packages/tests/c-flex.test.ts

Whitespace-only changes.

0 commit comments

Comments
 (0)