@@ -24,7 +24,7 @@ test.describe('Collections', () => {
2424 test ( 'displays the sort dropdown on collection pages' , async ( { page} ) => {
2525 await page . goto ( COLLECTION_URL ) ;
2626
27- const sortSelect = page . getByLabel ( ' Sort by:') ;
27+ const sortSelect = page . getByRole ( 'combobox' , { name : ' Sort by:'} ) ;
2828 await expect ( sortSelect ) . toBeVisible ( ) ;
2929 } ) ;
3030
@@ -33,7 +33,7 @@ test.describe('Collections', () => {
3333 } ) => {
3434 await page . goto ( COLLECTION_URL ) ;
3535
36- const sortSelect = page . getByLabel ( ' Sort by:') ;
36+ const sortSelect = page . getByRole ( 'combobox' , { name : ' Sort by:'} ) ;
3737 await sortSelect . selectOption ( 'PRICE_LOW_TO_HIGH' ) ;
3838
3939 await expect ( page ) . toHaveURL ( / s o r t _ b y = P R I C E _ L O W _ T O _ H I G H / ) ;
@@ -44,7 +44,7 @@ test.describe('Collections', () => {
4444 } ) => {
4545 await page . goto ( `${ COLLECTION_URL } ?sort_by=PRICE_LOW_TO_HIGH` ) ;
4646
47- const sortSelect = page . getByLabel ( ' Sort by:') ;
47+ const sortSelect = page . getByRole ( 'combobox' , { name : ' Sort by:'} ) ;
4848 await expect ( sortSelect ) . toHaveValue ( 'PRICE_LOW_TO_HIGH' ) ;
4949
5050 await sortSelect . selectOption ( 'FEATURED' ) ;
@@ -55,7 +55,7 @@ test.describe('Collections', () => {
5555 test ( 'preserves sort selection after page reload' , async ( { page} ) => {
5656 await page . goto ( `${ COLLECTION_URL } ?sort_by=PRICE_HIGH_TO_LOW` ) ;
5757
58- const sortSelect = page . getByLabel ( ' Sort by:') ;
58+ const sortSelect = page . getByRole ( 'combobox' , { name : ' Sort by:'} ) ;
5959 await expect ( sortSelect ) . toHaveValue ( 'PRICE_HIGH_TO_LOW' ) ;
6060
6161 await page . reload ( ) ;
@@ -153,7 +153,7 @@ test.describe('Collections', () => {
153153 await expect ( page ) . toHaveURL ( / f i l t e r \. / ) ;
154154
155155 // Change sort
156- const sortSelect = page . getByLabel ( ' Sort by:') ;
156+ const sortSelect = page . getByRole ( 'combobox' , { name : ' Sort by:'} ) ;
157157 await sortSelect . selectOption ( 'PRICE_LOW_TO_HIGH' ) ;
158158
159159 // Both should be in the URL
0 commit comments