@@ -9,8 +9,8 @@ import UserSelect from './UserSelect.story.vue'
99test ( 'has options' , async ( { mount, page } ) => {
1010 const component = await mount ( UserSelect )
1111
12- await expect ( component . getByRole ( 'searchbox ' ) ) . toBeVisible ( )
13- await component . getByRole ( 'searchbox ' ) . click ( )
12+ await expect ( component . getByRole ( 'combobox ' ) ) . toBeVisible ( )
13+ await component . getByRole ( 'combobox ' ) . click ( )
1414
1515 expect ( await page . getByRole ( 'option' ) . all ( ) ) . toHaveLength ( 3 )
1616 await expect ( page . getByRole ( 'option' , { name : 'Olivia' } ) ) . toBeVisible ( )
@@ -21,8 +21,8 @@ test('has options', async ({ mount, page }) => {
2121test ( 'can filter by name' , async ( { mount, page } ) => {
2222 const component = await mount ( UserSelect )
2323
24- await expect ( component . getByRole ( 'searchbox ' ) ) . toBeVisible ( )
25- await component . getByRole ( 'searchbox ' ) . fill ( 'Em' )
24+ await expect ( component . getByRole ( 'combobox ' ) ) . toBeVisible ( )
25+ await component . getByRole ( 'combobox ' ) . fill ( 'Em' )
2626
2727 await expect ( page . getByRole ( 'option' , { name : 'Emma' } ) ) . toBeVisible ( )
2828 expect ( await page . getByRole ( 'option' ) . all ( ) ) . toHaveLength ( 1 )
@@ -31,8 +31,8 @@ test('can filter by name', async ({ mount, page }) => {
3131test ( 'can filter by mail' , async ( { mount, page } ) => {
3232 const component = await mount ( UserSelect )
3333
34- await expect ( component . getByRole ( 'searchbox ' ) ) . toBeVisible ( )
35- await component . getByRole ( 'searchbox ' ) . fill ( 'olivia@example' )
34+ await expect ( component . getByRole ( 'combobox ' ) ) . toBeVisible ( )
35+ await component . getByRole ( 'combobox ' ) . fill ( 'olivia@example' )
3636
3737 await expect ( page . getByRole ( 'option' , { name : 'Olivia' } ) ) . toBeVisible ( )
3838 expect ( await page . getByRole ( 'option' ) . all ( ) ) . toHaveLength ( 1 )
@@ -49,18 +49,18 @@ test(
4949 async ( { mount, page } ) => {
5050 const component = await mount ( UserSelect )
5151
52- await expect ( component . getByRole ( 'searchbox ' ) ) . toBeVisible ( )
53- await component . getByRole ( 'searchbox ' ) . fill ( 'O. <' )
52+ await expect ( component . getByRole ( 'combobox ' ) ) . toBeVisible ( )
53+ await component . getByRole ( 'combobox ' ) . fill ( 'O. <' )
5454
5555 // should not exist right now as neither Name no email provided
5656 await expect ( page . getByText ( 'No results' ) ) . toBeVisible ( )
5757 expect ( await page . getByRole ( 'option' , { name : 'Olivia' } ) . all ( ) ) . toHaveLength ( 0 )
5858
59- await component . getByRole ( 'searchbox ' ) . fill ( 'O. <olivia' )
59+ await component . getByRole ( 'combobox ' ) . fill ( 'O. <olivia' )
6060 // now it should match the name
6161 await expect ( page . getByRole ( 'option' , { name : 'Olivia' } ) ) . toBeVisible ( )
6262
63- await component . getByRole ( 'searchbox ' ) . fill ( 'O. <olivia@example.org>' )
63+ await component . getByRole ( 'combobox ' ) . fill ( 'O. <olivia@example.org>' )
6464 // now it should match the email
6565 await expect ( page . getByRole ( 'option' , { name : 'Olivia' } ) ) . toBeVisible ( )
6666 expect ( await page . getByRole ( 'option' ) . all ( ) ) . toHaveLength ( 1 )
@@ -75,8 +75,8 @@ test('can select option', async ({ mount, page }) => {
7575 } ,
7676 } )
7777
78- await expect ( component . getByRole ( 'searchbox ' ) ) . toBeVisible ( )
79- await component . getByRole ( 'searchbox ' ) . click ( )
78+ await expect ( component . getByRole ( 'combobox ' ) ) . toBeVisible ( )
79+ await component . getByRole ( 'combobox ' ) . click ( )
8080
8181 await expect ( page . getByRole ( 'option' , { name : 'Olivia' } ) ) . toBeVisible ( )
8282 await page . getByRole ( 'option' , { name : 'Olivia' } ) . click ( )
@@ -86,8 +86,8 @@ test('can select option', async ({ mount, page }) => {
8686 id : '0-olivia' ,
8787 } )
8888
89- await expect ( component . getByRole ( 'searchbox ' ) ) . toBeVisible ( )
90- await component . getByRole ( 'searchbox ' ) . click ( )
89+ await expect ( component . getByRole ( 'combobox ' ) ) . toBeVisible ( )
90+ await component . getByRole ( 'combobox ' ) . click ( )
9191
9292 await expect ( page . getByRole ( 'option' , { name : 'John' } ) ) . toBeVisible ( )
9393 await page . getByRole ( 'option' , { name : 'John' } ) . click ( )
@@ -109,14 +109,14 @@ test('can select multiple option', async ({ mount, page }) => {
109109 } ,
110110 } )
111111
112- await expect ( component . getByRole ( 'searchbox ' ) ) . toBeVisible ( )
113- await component . getByRole ( 'searchbox ' ) . click ( )
112+ await expect ( component . getByRole ( 'combobox ' ) ) . toBeVisible ( )
113+ await component . getByRole ( 'combobox ' ) . click ( )
114114
115115 await expect ( page . getByRole ( 'option' , { name : 'Olivia' } ) ) . toBeVisible ( )
116116 await page . getByRole ( 'option' , { name : 'Olivia' } ) . click ( )
117117
118- await expect ( component . getByRole ( 'searchbox ' ) ) . toBeVisible ( )
119- await component . getByRole ( 'searchbox ' ) . click ( )
118+ await expect ( component . getByRole ( 'combobox ' ) ) . toBeVisible ( )
119+ await component . getByRole ( 'combobox ' ) . click ( )
120120 await expect ( page . getByRole ( 'option' , { name : 'John' } ) ) . toBeVisible ( )
121121 await page . getByRole ( 'option' , { name : 'John' } ) . click ( )
122122
0 commit comments