@@ -10,7 +10,7 @@ import {
10
10
useFormControl ,
11
11
} from "../src"
12
12
import * as Examples from "../examples"
13
- import { CInput } from "@chakra-ui /c-input"
13
+ import { CInput } from "../.. /c-input"
14
14
15
15
describe ( "FormControl Examples" , ( ) => {
16
16
Object . entries ( Examples ) . map ( ( [ name , example ] ) => {
@@ -25,7 +25,7 @@ const render = (props: any = {}) => {
25
25
return h ( ( ) => (
26
26
< CFormControl id = "name" { ...props } >
27
27
< CFormLabel > Name</ CFormLabel >
28
- < CInput placeholder = "Name" />
28
+ < CInput id = "name" placeholder = "Name" />
29
29
< CFormHelperText > Enter your name please!</ CFormHelperText >
30
30
< CFormErrorMessage > Your name is invalid</ CFormErrorMessage >
31
31
</ CFormControl >
@@ -51,7 +51,7 @@ describe("<CFormControl />", () => {
51
51
return h ( ( ) => (
52
52
< CFormControl id = "name" >
53
53
< CFormLabel > Name</ CFormLabel >
54
- < CInput placeholder = "Name" />
54
+ < CInput id = "name" placeholder = "Name" />
55
55
< CFormHelperText > Enter your name please!</ CFormHelperText >
56
56
< CFormErrorMessage data-testid = "message" >
57
57
< CFormErrorIcon data-testid = "icon" />
@@ -69,7 +69,7 @@ describe("<CFormControl />", () => {
69
69
return h ( ( ) => (
70
70
< CFormControl id = "other-name" >
71
71
< CFormLabel > Name</ CFormLabel >
72
- < CInput placeholder = "Name" />
72
+ < CInput id = "other-name" placeholder = "Name" />
73
73
< CFormHelperText > Enter your name please!</ CFormHelperText >
74
74
< CFormErrorMessage > Your name is invalid</ CFormErrorMessage >
75
75
</ CFormControl >
@@ -92,6 +92,7 @@ describe("<CFormControl />", () => {
92
92
< CFormControl id = "other-name" >
93
93
< CFormLabel > Name</ CFormLabel >
94
94
< CInput
95
+ id = "other-name"
95
96
placeholder = "Name"
96
97
data-testid = "input"
97
98
onFocus = { onFocus }
@@ -115,12 +116,12 @@ describe("<CFormControl />", () => {
115
116
116
117
// Here attrsibtutes a re renderedn correctly in DOM but not in
117
118
// test environment. Not sure why
118
- it . skip ( "has the proper aria-attibutes" , ( ) => {
119
+ it ( "has the proper aria-attibutes" , ( ) => {
119
120
cy . mount ( ( ) => {
120
121
return h ( ( ) => (
121
122
< CFormControl id = "name" >
122
123
< CFormLabel > First name </ CFormLabel >
123
- < CInput data-testid = "input" placeholder = "First Name" />
124
+ < CInput id = "name" data-testid = "input" placeholder = "First Name" />
124
125
< CFormHelperText > Keep it very short and sweet! </ CFormHelperText >
125
126
</ CFormControl >
126
127
) )
@@ -129,8 +130,8 @@ describe("<CFormControl />", () => {
129
130
cy . get ( '[data-testid="input"]' )
130
131
. should ( "have.attr" , "aria-describedby" , "helptext-name" )
131
132
. should ( "not.have.attr" , "aria-invalid" )
132
- . should ( "not.have.attr" , "aria-required" )
133
- . should ( "not.have.attr" , "aria-readonly" )
133
+ cy . get ( '[data-testid="input"]' ) . should ( "not.have.attr" , "aria-required" )
134
+ cy . get ( '[data-testid="input"]' ) . should ( "not.have.attr" , "aria-readonly" )
134
135
} )
135
136
} )
136
137
0 commit comments