@@ -36,20 +36,20 @@ test.describe("Preferences user settings tab", () => {
36
36
37
37
test ( "should be able to change the app language" , async ( { uut, user } ) => {
38
38
// Check language and region setting dropdown
39
- const languageInput = uut . locator ( ".mx_PreferencesUserSettingsTab_section_languageInput" ) ;
39
+ const languageInput = uut . getByRole ( "button" , { name : "Language Dropdown" } ) ;
40
40
await languageInput . scrollIntoViewIfNeeded ( ) ;
41
41
// Check the default value
42
42
await expect ( languageInput . getByText ( "English" ) ) . toBeVisible ( ) ;
43
43
// Click the button to display the dropdown menu
44
- await languageInput . getByRole ( "button" , { name : "Language Dropdown" } ) . click ( ) ;
44
+ await languageInput . click ( ) ;
45
45
// Assert that the default option is rendered and highlighted
46
46
languageInput . getByRole ( "option" , { name : / A l b a n i a n / } ) ;
47
47
await expect ( languageInput . getByRole ( "option" , { name : / A l b a n i a n / } ) ) . toHaveClass (
48
48
/ m x _ D r o p d o w n _ o p t i o n _ h i g h l i g h t / ,
49
49
) ;
50
50
await expect ( languageInput . getByRole ( "option" , { name : / D e u t s c h / } ) ) . toBeVisible ( ) ;
51
51
// Click again to close the dropdown
52
- await languageInput . getByRole ( "button" , { name : "Language Dropdown" } ) . click ( ) ;
52
+ await languageInput . click ( ) ;
53
53
// Assert that the default value is rendered again
54
54
await expect ( languageInput . getByText ( "English" ) ) . toBeVisible ( ) ;
55
55
} ) ;
0 commit comments