@@ -78,20 +78,25 @@ async function makeWrapper() {
7878 routes,
7979 stubs : [ 'AppBarPage' ] ,
8080 } ) ;
81-
81+
8282 // Need to wait for beforeMount to finish
8383 await global . flushPromises ( ) ;
8484}
8585
86-
8786function getButtons ( ) {
8887 const saveButton = screen . getByRole ( 'button' , { name : / s a v e c h a n g e s / i } ) ;
8988 const learnPage = screen . getByRole ( 'radio' , { name : / L e a r n p a g e / i } ) ;
9089 const signInPage = screen . getByRole ( 'radio' , { name : / S i g n - i n p a g e / i } ) ;
91- const allowGuestAccess = screen . getByRole ( 'radio' , { name : / A l l o w u s e r s t o e x p l o r e r e s o u r c e s w i t h o u t s i g n i n g i n / i } ) ;
92- const disallowGuestAccess = screen . getByRole ( 'radio' , { name : / L e a r n e r s m u s t s i g n i n t o e x p l o r e r e s o u r c e s / i } ) ;
93- const lockedContent = screen . getByRole ( 'radio' , { name : / S i g n e d i n l e a r n e r s s h o u l d o n l y s e e r e s o u r c e s a s s i g n e d t o t h e m i n c l a s s e s / i } ) ;
94-
90+ const allowGuestAccess = screen . getByRole ( 'radio' , {
91+ name : / A l l o w u s e r s t o e x p l o r e r e s o u r c e s w i t h o u t s i g n i n g i n / i,
92+ } ) ;
93+ const disallowGuestAccess = screen . getByRole ( 'radio' , {
94+ name : / L e a r n e r s m u s t s i g n i n t o e x p l o r e r e s o u r c e s / i,
95+ } ) ;
96+ const lockedContent = screen . getByRole ( 'radio' , {
97+ name : / S i g n e d i n l e a r n e r s s h o u l d o n l y s e e r e s o u r c e s a s s i g n e d t o t h e m i n c l a s s e s / i,
98+ } ) ;
99+
95100 return {
96101 learnPage,
97102 signInPage,
@@ -110,7 +115,7 @@ function assertIsDisabled(button, expected) {
110115 if ( expected ) {
111116 expect ( button ) . toBeDisabled ( ) ;
112117 } else {
113- expect ( button ) . not . toBeDisabled ( ) ;
118+ expect ( button ) . toBeEnabled ( ) ;
114119 }
115120}
116121
@@ -122,7 +127,6 @@ function assertIsSelected(button, expected) {
122127 }
123128}
124129
125-
126130describe ( 'DeviceSettingsPage' , ( ) => {
127131 beforeEach ( ( ) => {
128132 jest . clearAllMocks ( ) ;
@@ -276,7 +280,7 @@ describe('DeviceSettingsPage', () => {
276280 await clickRadioButton ( lockedContent ) ;
277281 await fireEvent . click ( saveButton ) ;
278282
279- await global . flushPromises ( ) ;
283+ await global . flushPromises ( ) ;
280284 // Implications: Cannot see "explore without account" AND cannot see "channels" tab
281285 expect ( api . saveDeviceSettings ) . toHaveBeenCalledWith (
282286 expect . objectContaining ( {
@@ -288,4 +292,3 @@ describe('DeviceSettingsPage', () => {
288292 } ) ;
289293 } ) ;
290294} ) ;
291-
0 commit comments