@@ -165,7 +165,9 @@ describe('WalletAdvancedQrReceive', () => {
165
165
166
166
render ( < WalletAdvancedQrReceive /> ) ;
167
167
168
- const copyIcon = screen . getByTestId ( 'ockWalletAdvancedQrReceive_CopyIcon' ) ;
168
+ const copyIcon = screen . getByRole ( 'button' , {
169
+ name : 'Copy your address by clicking the icon' ,
170
+ } ) ;
169
171
170
172
await act ( async ( ) => {
171
173
fireEvent . click ( copyIcon ) ;
@@ -176,9 +178,9 @@ describe('WalletAdvancedQrReceive', () => {
176
178
expect ( mockClipboard . writeText ) . toHaveBeenCalledWith ( '0x1234567890' ) ;
177
179
expect ( mockSetCopyText ) . toHaveBeenCalledWith ( 'Copied' ) ;
178
180
179
- const tooltip = screen . getByTestId (
180
- 'ockWalletAdvancedQrReceive_CopyTooltip ',
181
- ) ;
181
+ const tooltip = screen . getByRole ( 'button' , {
182
+ name : 'Copy your address by clicking the tooltip ',
183
+ } ) ;
182
184
expect ( tooltip ) . toBeInTheDocument ( ) ;
183
185
184
186
vi . advanceTimersByTime ( 2000 ) ;
@@ -205,9 +207,9 @@ describe('WalletAdvancedQrReceive', () => {
205
207
206
208
render ( < WalletAdvancedQrReceive /> ) ;
207
209
208
- const copyTooltip = screen . getByTestId (
209
- 'ockWalletAdvancedQrReceive_CopyTooltip ',
210
- ) ;
210
+ const copyTooltip = screen . getByRole ( 'button' , {
211
+ name : 'Copy your address by clicking the tooltip ',
212
+ } ) ;
211
213
212
214
await act ( async ( ) => {
213
215
fireEvent . click ( copyTooltip ) ;
@@ -218,9 +220,9 @@ describe('WalletAdvancedQrReceive', () => {
218
220
expect ( mockClipboard . writeText ) . toHaveBeenCalledWith ( '0x1234567890' ) ;
219
221
expect ( mockSetCopyText ) . toHaveBeenCalledWith ( 'Copied' ) ;
220
222
221
- const tooltip = screen . getByTestId (
222
- 'ockWalletAdvancedQrReceive_CopyTooltip ',
223
- ) ;
223
+ const tooltip = screen . getByRole ( 'button' , {
224
+ name : 'Copy your address by clicking the tooltip ',
225
+ } ) ;
224
226
expect ( tooltip ) . toBeInTheDocument ( ) ;
225
227
226
228
vi . advanceTimersByTime ( 2000 ) ;
@@ -247,9 +249,9 @@ describe('WalletAdvancedQrReceive', () => {
247
249
248
250
render ( < WalletAdvancedQrReceive /> ) ;
249
251
250
- const copyButton = screen . getByTestId (
251
- 'ockCopyButton ',
252
- ) ;
252
+ const copyButton = screen . getByRole ( 'button' , {
253
+ name : 'Copy your address by clicking the button ',
254
+ } ) ;
253
255
254
256
await act ( async ( ) => {
255
257
fireEvent . click ( copyButton ) ;
@@ -280,7 +282,9 @@ describe('WalletAdvancedQrReceive', () => {
280
282
render ( < WalletAdvancedQrReceive /> ) ;
281
283
282
284
mockSetCopyText . mockClear ( ) ;
283
- const copyIcon = screen . getByTestId ( 'ockWalletAdvancedQrReceive_CopyIcon' ) ;
285
+ const copyIcon = screen . getByRole ( 'button' , {
286
+ name : 'Copy your address by clicking the icon' ,
287
+ } ) ;
284
288
await act ( async ( ) => {
285
289
fireEvent . click ( copyIcon ) ;
286
290
await Promise . resolve ( ) ;
@@ -292,9 +296,9 @@ describe('WalletAdvancedQrReceive', () => {
292
296
vi . advanceTimersByTime ( 2000 ) ;
293
297
294
298
mockSetCopyButtonText . mockClear ( ) ;
295
- const copyButton = screen . getByTestId (
296
- 'ockCopyButton ',
297
- ) ;
299
+ const copyButton = screen . getByRole ( 'button' , {
300
+ name : 'Copy your address by clicking the button ',
301
+ } ) ;
298
302
await act ( async ( ) => {
299
303
fireEvent . click ( copyButton ) ;
300
304
await Promise . resolve ( ) ;
@@ -315,7 +319,9 @@ describe('WalletAdvancedQrReceive', () => {
315
319
316
320
render ( < WalletAdvancedQrReceive /> ) ;
317
321
318
- const copyIcon = screen . getByTestId ( 'ockWalletAdvancedQrReceive_CopyIcon' ) ;
322
+ const copyIcon = screen . getByRole ( 'button' , {
323
+ name : 'Copy your address by clicking the icon' ,
324
+ } ) ;
319
325
fireEvent . click ( copyIcon ) ;
320
326
321
327
expect ( mockClipboard . writeText ) . toHaveBeenCalledWith ( '' ) ;
0 commit comments