@@ -33,43 +33,6 @@ test.describe("Appearance user settings tab", () => {
33
33
await expect ( tab ) . toMatchScreenshot ( "appearance-tab.png" ) ;
34
34
} ) ;
35
35
36
- test ( "should support switching layouts" , async ( { page, user, app } ) => {
37
- // Create and view a room first
38
- await app . client . createRoom ( { name : "Test Room" } ) ;
39
- await app . viewRoomByName ( "Test Room" ) ;
40
-
41
- await app . settings . openUserSettings ( "Appearance" ) ;
42
-
43
- const buttons = page . locator ( ".mx_LayoutSwitcher_RadioButton" ) ;
44
-
45
- // Assert that the layout selected by default is "Modern"
46
- await expect (
47
- buttons . locator ( ".mx_StyledRadioButton_enabled" , {
48
- hasText : "Modern" ,
49
- } ) ,
50
- ) . toBeVisible ( ) ;
51
-
52
- // Assert that the room layout is set to group (modern) layout
53
- await expect ( page . locator ( ".mx_RoomView_body[data-layout='group']" ) ) . toBeVisible ( ) ;
54
-
55
- // Select the first layout
56
- await buttons . first ( ) . click ( ) ;
57
- // Assert that the layout selected is "IRC (Experimental)"
58
- await expect ( buttons . locator ( ".mx_StyledRadioButton_enabled" , { hasText : "IRC (Experimental)" } ) ) . toBeVisible ( ) ;
59
-
60
- // Assert that the room layout is set to IRC layout
61
- await expect ( page . locator ( ".mx_RoomView_body[data-layout='irc']" ) ) . toBeVisible ( ) ;
62
-
63
- // Select the last layout
64
- await buttons . last ( ) . click ( ) ;
65
-
66
- // Assert that the layout selected is "Message bubbles"
67
- await expect ( buttons . locator ( ".mx_StyledRadioButton_enabled" , { hasText : "Message bubbles" } ) ) . toBeVisible ( ) ;
68
-
69
- // Assert that the room layout is set to bubble layout
70
- await expect ( page . locator ( ".mx_RoomView_body[data-layout='bubble']" ) ) . toBeVisible ( ) ;
71
- } ) ;
72
-
73
36
test ( "should support changing font size by using the font size dropdown" , async ( { page, app, user } ) => {
74
37
await app . settings . openUserSettings ( "Appearance" ) ;
75
38
@@ -84,69 +47,80 @@ test.describe("Appearance user settings tab", () => {
84
47
await expect ( page ) . toMatchScreenshot ( "window-12px.png" ) ;
85
48
} ) ;
86
49
87
- test ( "should support enabling compact group (modern) layout" , async ( { page, app, user } ) => {
88
- // Create and view a room first
89
- await app . client . createRoom ( { name : "Test Room" } ) ;
90
- await app . viewRoomByName ( "Test Room" ) ;
91
-
50
+ test ( "should support enabling system font" , async ( { page, app, user } ) => {
92
51
await app . settings . openUserSettings ( "Appearance" ) ;
52
+ const tab = page . getByTestId ( "mx_AppearanceUserSettingsTab" ) ;
93
53
94
54
// Click "Show advanced" link button
95
- const tab = page . getByTestId ( "mx_AppearanceUserSettingsTab" ) ;
96
55
await tab . getByRole ( "button" , { name : "Show advanced" } ) . click ( ) ;
97
56
98
- await tab . locator ( "label" , { hasText : "Use a more compact 'Modern' layout" } ) . click ( ) ;
57
+ await tab . locator ( ".mx_Checkbox" , { hasText : "Use bundled emoji font" } ) . click ( ) ;
58
+ await tab . locator ( ".mx_Checkbox" , { hasText : "Use a system font" } ) . click ( ) ;
99
59
100
- // Assert that the room layout is set to compact group (modern) layout
101
- await expect ( page . locator ( "#matrixchat .mx_MatrixChat_wrapper.mx_MatrixChat_useCompactLayout " ) ) . toBeVisible ( ) ;
60
+ // Assert that the font-family value was removed
61
+ await expect ( page . locator ( "body " ) ) . toHaveCSS ( "font-family" , '""' ) ;
102
62
} ) ;
103
63
104
- test ( "should disable compact group (modern) layout option on IRC layout and bubble layout" , async ( {
105
- page,
106
- app,
107
- user,
108
- } ) => {
109
- await app . settings . openUserSettings ( "Appearance" ) ;
110
- const tab = page . getByTestId ( "mx_AppearanceUserSettingsTab" ) ;
111
-
112
- const checkDisabled = async ( ) => {
113
- await expect ( tab . getByRole ( "checkbox" , { name : "Use a more compact 'Modern' layout" } ) ) . toBeDisabled ( ) ;
114
- } ;
64
+ test . describe ( "Message Layout Panel" , ( ) => {
65
+ test . beforeEach ( async ( { app, user, util } ) => {
66
+ await util . createAndDisplayRoom ( ) ;
67
+ await util . assertModernLayout ( ) ;
68
+ await util . openAppearanceTab ( ) ;
69
+ } ) ;
115
70
116
- // Click "Show advanced" link button
117
- await tab . getByRole ( "button" , { name : "Show advanced" } ) . click ( ) ;
71
+ test ( "should change the message layout from modern to bubble" , async ( { page , app , user , util } ) => {
72
+ await expect ( util . getMessageLayoutPanel ( ) ) . toMatchScreenshot ( "message-layout-panel-modern.png" ) ;
118
73
119
- const buttons = page . locator ( ".mx_LayoutSwitcher_RadioButton" ) ;
74
+ await util . getBubbleLayout ( ) . click ( ) ;
120
75
121
- // Enable IRC layout
122
- await buttons . first ( ) . click ( ) ;
76
+ // Assert that modern are irc layout are not selected
77
+ await expect ( util . getBubbleLayout ( ) ) . toBeChecked ( ) ;
78
+ await expect ( util . getModernLayout ( ) ) . not . toBeChecked ( ) ;
79
+ await expect ( util . getIRCLayout ( ) ) . not . toBeChecked ( ) ;
123
80
124
- // Assert that the layout selected is "IRC (Experimental)"
125
- await expect ( buttons . locator ( ".mx_StyledRadioButton_enabled" , { hasText : "IRC (Experimental)" } ) ) . toBeVisible ( ) ;
81
+ // Assert that the room layout is set to bubble layout
82
+ await util . assertBubbleLayout ( ) ;
83
+ await expect ( util . getMessageLayoutPanel ( ) ) . toMatchScreenshot ( "message-layout-panel-bubble.png" ) ;
84
+ } ) ;
126
85
127
- await checkDisabled ( ) ;
86
+ test ( "should enable compact layout when the modern layout is selected" , async ( { page, app, user, util } ) => {
87
+ await expect ( util . getCompactLayoutCheckbox ( ) ) . not . toBeChecked ( ) ;
128
88
129
- // Enable bubble layout
130
- await buttons . last ( ) . click ( ) ;
89
+ await util . getCompactLayoutCheckbox ( ) . click ( ) ;
90
+ await util . assertCompactLayout ( ) ;
91
+ } ) ;
131
92
132
- // Assert that the layout selected is "IRC (Experimental)"
133
- await expect ( buttons . locator ( ".mx_StyledRadioButton_enabled" , { hasText : "Message bubbles" } ) ) . toBeVisible ( ) ;
93
+ test ( "should disable compact layout when the modern layout is not selected" , async ( {
94
+ page,
95
+ app,
96
+ user,
97
+ util,
98
+ } ) => {
99
+ await expect ( util . getCompactLayoutCheckbox ( ) ) . not . toBeDisabled ( ) ;
100
+
101
+ // Select the bubble layout, which should disable the compact layout checkbox
102
+ await util . getBubbleLayout ( ) . click ( ) ;
103
+ await expect ( util . getCompactLayoutCheckbox ( ) ) . toBeDisabled ( ) ;
104
+ } ) ;
134
105
135
- await checkDisabled ( ) ;
136
- } ) ;
106
+ test . skip ( "should support enabling compact group (modern) layout" , async ( { page, app, user } ) => {
107
+ // Create and view a room first
108
+ await app . client . createRoom ( { name : "Test Room" } ) ;
109
+ await app . viewRoomByName ( "Test Room" ) ;
137
110
138
- test ( "should support enabling system font" , async ( { page, app, user } ) => {
139
- await app . settings . openUserSettings ( "Appearance" ) ;
140
- const tab = page . getByTestId ( "mx_AppearanceUserSettingsTab" ) ;
111
+ await app . settings . openUserSettings ( "Appearance" ) ;
141
112
142
- // Click "Show advanced" link button
143
- await tab . getByRole ( "button" , { name : "Show advanced" } ) . click ( ) ;
113
+ // Click "Show advanced" link button
114
+ const tab = page . getByTestId ( "mx_AppearanceUserSettingsTab" ) ;
115
+ await tab . getByRole ( "button" , { name : "Show advanced" } ) . click ( ) ;
144
116
145
- await tab . locator ( ".mx_Checkbox" , { hasText : "Use bundled emoji font" } ) . click ( ) ;
146
- await tab . locator ( ".mx_Checkbox" , { hasText : "Use a system font" } ) . click ( ) ;
117
+ await tab . locator ( "label" , { hasText : "Use a more compact 'Modern' layout" } ) . click ( ) ;
147
118
148
- // Assert that the font-family value was removed
149
- await expect ( page . locator ( "body" ) ) . toHaveCSS ( "font-family" , '""' ) ;
119
+ // Assert that the room layout is set to compact group (modern) layout
120
+ await expect (
121
+ page . locator ( "#matrixchat .mx_MatrixChat_wrapper.mx_MatrixChat_useCompactLayout" ) ,
122
+ ) . toBeVisible ( ) ;
123
+ } ) ;
150
124
} ) ;
151
125
152
126
test . describe ( "Theme Choice Panel" , ( ) => {
0 commit comments