@@ -41,7 +41,7 @@ describe('RemoteShareDialog', () => {
4141 } ,
4242 } )
4343
44- await expect ( findByLabelText ( component . element , 'Remote share password' ) ) . rejects . toThrow ( )
44+ await expect ( findByLabelText ( document . body , 'Remote share password' ) ) . rejects . toThrow ( )
4545 } )
4646
4747 it ( 'emits true when accepted' , async ( ) => {
@@ -59,7 +59,7 @@ describe('RemoteShareDialog', () => {
5959 } ,
6060 } )
6161
62- const button = getByRole ( component . element , 'button' , { name : 'Cancel' } )
62+ const button = getByRole ( document . body , 'button' , { name : 'Cancel' } )
6363 await fireEvent . click ( button )
6464 expect ( onClose ) . toHaveBeenCalledWith ( false )
6565 } )
@@ -74,7 +74,7 @@ describe('RemoteShareDialog', () => {
7474 } ,
7575 } )
7676
77- await expect ( findByLabelText ( component . element , 'Remote share password' ) ) . resolves . not . toThrow ( )
77+ await expect ( findByLabelText ( document . body , 'Remote share password' ) ) . resolves . not . toThrow ( )
7878 } )
7979
8080 it ( 'emits the submitted password' , async ( ) => {
@@ -92,9 +92,9 @@ describe('RemoteShareDialog', () => {
9292 } ,
9393 } )
9494
95- const input = getByLabelText ( component . element , 'Remote share password' )
95+ const input = getByLabelText ( document . body , 'Remote share password' )
9696 await fireEvent . update ( input , 'my password' )
97- const button = getByRole ( component . element , 'button' , { name : 'Add remote share' } )
97+ const button = getByRole ( document . body , 'button' , { name : 'Add remote share' } )
9898 await fireEvent . click ( button )
9999 expect ( onClose ) . toHaveBeenCalledWith ( true , 'my password' )
100100 } )
@@ -114,9 +114,9 @@ describe('RemoteShareDialog', () => {
114114 } ,
115115 } )
116116
117- const input = getByLabelText ( component . element , 'Remote share password' )
117+ const input = getByLabelText ( document . body , 'Remote share password' )
118118 await fireEvent . update ( input , 'my password' )
119- const button = getByRole ( component . element , 'button' , { name : 'Cancel' } )
119+ const button = getByRole ( document . body , 'button' , { name : 'Cancel' } )
120120 await fireEvent . click ( button )
121121 expect ( onClose ) . toHaveBeenCalledWith ( false )
122122 } )
0 commit comments