|
1 | 1 | import * as React from 'react'; |
2 | | -import { expect, screen, userEvent, within } from 'storybook/test'; |
| 2 | +import { expect, screen, userEvent, waitFor, within } from 'storybook/test'; |
3 | 3 |
|
4 | 4 | import { TYPE_FILE } from '../../../../constants'; |
5 | 5 | import { |
@@ -52,14 +52,16 @@ export const withCollaborators = { |
52 | 52 | }, |
53 | 53 | play: async context => { |
54 | 54 | await withModernization.play(context); |
55 | | - const sharedWithAvatars = screen.getByRole('button', { name: 'Shared with D R D' }); |
56 | | - expect(sharedWithAvatars).toBeVisible(); |
57 | | - await userEvent.click(sharedWithAvatars); |
| 55 | + await waitFor(async () => { |
| 56 | + const sharedWithAvatars = screen.getByRole('button', { name: 'Shared with D R D' }); |
| 57 | + expect(sharedWithAvatars).toBeVisible(); |
| 58 | + await userEvent.click(sharedWithAvatars); |
58 | 59 |
|
59 | | - expect(screen.getByRole('link', { name: 'Manage All' })).toBeVisible(); |
60 | | - expect(screen.getByRole('grid', { name: 'Collaborators' })).toBeVisible(); |
61 | | - expect(screen.getByRole('row', { name: /Detective Parrot/ })).toBeVisible(); |
62 | | - expect(screen.getByRole('button', { name: 'Done' })).toBeVisible(); |
| 60 | + expect(screen.getByRole('link', { name: 'Manage All' })).toBeVisible(); |
| 61 | + expect(screen.getByRole('grid', { name: 'Collaborators' })).toBeVisible(); |
| 62 | + expect(screen.getByRole('row', { name: /Detective Parrot/ })).toBeVisible(); |
| 63 | + expect(screen.getByRole('button', { name: 'Done' })).toBeVisible(); |
| 64 | + }); |
63 | 65 | }, |
64 | 66 | }; |
65 | 67 |
|
|
0 commit comments