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

Commit 39852d3

Browse files
committed
chore: ficed component types
1 parent de2eaa3 commit 39852d3

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

packages/c-alert/tests/c-alert.cy.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { CAlert, CAlertDescription, CAlertIcon, CAlertTitle } from '../src'
55
describe('Alert Examples', () => {
66
Object.entries(Examples).map(([name, example]) => {
77
it(`renders ${name} successfully`, () => {
8-
cy.mount(example.default).checkA11y()
8+
cy.mount(example.default)
9+
.then(() => {})
10+
.checkA11y()
911
})
1012
})
1113
})

tests/index.d.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
11
/// <reference types="cypress" />
22

3+
import { ChakraProps, HTMLChakraProps } from '@chakra-ui/vue-system'
34
import { mount } from '@cypress/vue'
45

6+
type ReturnedChainableMount = Chainable<ReturnType<typeof mount>>
7+
8+
interface MountFunction extends ReturnedChainableMount {
9+
checkA11y(options?: any, params?: object): Chainable
10+
then: (rtn?: any) => any
11+
get: (qry: string) => ReturnedChainableMount
12+
}
13+
514
declare global {
6-
namespace Cypress {
15+
declare namespace Cypress {
716
export interface Chainable {
8-
mount(): ReturnType<typeof mount>
17+
mount(component: any): MountFunction
918
/**
1019
* Run a11y tests or only a subset of all tests
1120
* @see https://github.com/avanslaars/cypress-axe
1221
* @example
1322
* cy.checkA11y()
1423
*/
15-
checkA11y(any, object): Chainable
24+
checkA11y(options?: any, params?: object): Chainable
1625
}
1726
}
27+
declare namespace JSX {
28+
export interface IntrinsicAttributes extends ChakraProps {}
29+
}
1830
}

tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
44
"module": "esnext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
55
"resolveJsonModule": true,
6-
"lib": [ "esnext", "dom" ],
7-
"types": ["node", "jest", "vite/client", "vite-plugin-pages/client", "cypress", "@chakra-ui/vue-cypress-tests"],
6+
"lib": [ "es5", "esnext", "dom" ],
7+
"types": ["node", "jest", "vite/client", "vite-plugin-pages/client", "cypress"],
88
"declaration": true,
99
"allowJs": true,
1010
"sourceMap": true,
@@ -28,7 +28,7 @@
2828
"playground/**/*.d.ts",
2929
"playground/**/*.tsx",
3030
"playground/**/*.vue",
31-
"@chakra-ui/vue-cypress-tests"
31+
"tests/index.d.ts"
3232
],
3333
"exclude": ["node_modules", "./@types", "dist"],
3434
"ts-node": {

0 commit comments

Comments
 (0)