@@ -54,34 +54,36 @@ widgetTest(
5454 . contentFrame ( ) ;
5555
5656 // ASSERT the button states for whistler (the callee)
57- {
58- // The only way to know if it is muted or not is to look at the data-kind attribute..
59- const videoButton = whistlerFrame . getByTestId ( "incall_videomute" ) ;
60- // video should be off by default in a voice call
61- await expect ( videoButton ) . toHaveAttribute ( "aria-label" , / ^ S t a r t v i d e o $ / ) ;
62-
63- const audioButton = whistlerFrame . getByTestId ( "incall_mute" ) ;
64- // audio should be on for the voice call
65- await expect ( audioButton ) . toHaveAttribute (
66- "aria-label" ,
67- / ^ M u t e m i c r o p h o n e $ / ,
68- ) ;
69- }
57+ // video should be off by default in a voice call
58+ await expect (
59+ whistlerFrame . getByRole ( "switch" , {
60+ name : "Start video" ,
61+ checked : false ,
62+ } ) ,
63+ ) . toBeVisible ( ) ;
64+ // audio should be on for the voice call
65+ await expect (
66+ whistlerFrame . getByRole ( "switch" , {
67+ name : "Mute microphone" ,
68+ checked : true ,
69+ } ) ,
70+ ) . toBeVisible ( ) ;
7071
7172 // ASSERT the button states for brools (the caller)
72- {
73- // The only way to know if it is muted or not is to look at the data-kind attribute..
74- const videoButton = brooksFrame . getByTestId ( "incall_videomute" ) ;
75- // video should be off by default in a voice call
76- await expect ( videoButton ) . toHaveAttribute ( "aria-label" , / ^ S t a r t v i d e o $ / ) ;
77-
78- const audioButton = brooksFrame . getByTestId ( "incall_mute" ) ;
79- // audio should be on for the voice call
80- await expect ( audioButton ) . toHaveAttribute (
81- "aria-label" ,
82- / ^ M u t e m i c r o p h o n e $ / ,
83- ) ;
84- }
73+ // video should be off by default in a voice call
74+ await expect (
75+ whistlerFrame . getByRole ( "switch" , {
76+ name : "Start video" ,
77+ checked : false ,
78+ } ) ,
79+ ) . toBeVisible ( ) ;
80+ // audio should be on for the voice call
81+ await expect (
82+ whistlerFrame . getByRole ( "switch" , {
83+ name : "Mute microphone" ,
84+ checked : true ,
85+ } ) ,
86+ ) . toBeVisible ( ) ;
8587
8688 // In order to confirm that the call is disconnected we will check that the message composer is shown again.
8789 // So first we need to confirm that it is hidden when in the call.
@@ -93,10 +95,7 @@ widgetTest(
9395 ) . not . toBeVisible ( ) ;
9496
9597 // ASSERT hanging up on one side ends the call for both
96- {
97- const hangupButton = brooksFrame . getByTestId ( "incall_leave" ) ;
98- await hangupButton . click ( ) ;
99- }
98+ await brooksFrame . getByRole ( "button" , { name : "End call" } ) . click ( ) ;
10099
101100 // The widget should be closed on both sides and the timeline should be back on screen
102101 await expect (
@@ -148,34 +147,30 @@ widgetTest(
148147 . contentFrame ( ) ;
149148
150149 // ASSERT the button states for whistler (the callee)
151- {
152- // The only way to know if it is muted or not is to look at the data-kind attribute..
153- const videoButton = whistlerFrame . getByTestId ( "incall_videomute" ) ;
154- // video should be on by default in a voice call
155- await expect ( videoButton ) . toHaveAttribute ( "aria-label" , / ^ S t o p v i d e o $ / ) ;
156-
157- const audioButton = whistlerFrame . getByTestId ( "incall_mute" ) ;
158- // audio should be on for the voice call
159- await expect ( audioButton ) . toHaveAttribute (
160- "aria-label" ,
161- / ^ M u t e m i c r o p h o n e $ / ,
162- ) ;
163- }
150+ // video should be off by default in a video call
151+ await expect (
152+ whistlerFrame . getByRole ( "switch" , { name : "Stop video" , checked : true } ) ,
153+ ) . toBeVisible ( ) ;
154+ // audio should be on too
155+ await expect (
156+ whistlerFrame . getByRole ( "switch" , {
157+ name : "Mute microphone" ,
158+ checked : true ,
159+ } ) ,
160+ ) . toBeVisible ( ) ;
164161
165162 // ASSERT the button states for brools (the caller)
166- {
167- // The only way to know if it is muted or not is to look at the data-kind attribute..
168- const videoButton = brooksFrame . getByTestId ( "incall_videomute" ) ;
169- // video should be on by default in a voice call
170- await expect ( videoButton ) . toHaveAttribute ( "aria-label" , / ^ S t o p v i d e o $ / ) ;
171-
172- const audioButton = brooksFrame . getByTestId ( "incall_mute" ) ;
173- // audio should be on for the voice call
174- await expect ( audioButton ) . toHaveAttribute (
175- "aria-label" ,
176- / ^ M u t e m i c r o p h o n e $ / ,
177- ) ;
178- }
163+ // video should be off by default in a video call
164+ await expect (
165+ whistlerFrame . getByRole ( "switch" , { name : "Stop video" , checked : true } ) ,
166+ ) . toBeVisible ( ) ;
167+ // audio should be on too
168+ await expect (
169+ whistlerFrame . getByRole ( "switch" , {
170+ name : "Mute microphone" ,
171+ checked : true ,
172+ } ) ,
173+ ) . toBeVisible ( ) ;
179174
180175 // In order to confirm that the call is disconnected we will check that the message composer is shown again.
181176 // So first we need to confirm that it is hidden when in the call.
@@ -187,10 +182,7 @@ widgetTest(
187182 ) . not . toBeVisible ( ) ;
188183
189184 // ASSERT hanging up on one side ends the call for both
190- {
191- const hangupButton = brooksFrame . getByTestId ( "incall_leave" ) ;
192- await hangupButton . click ( ) ;
193- }
185+ await brooksFrame . getByRole ( "button" , { name : "End call" } ) . click ( ) ;
194186
195187 // The widget should be closed on both sides and the timeline should be back on screen
196188 await expect (
0 commit comments