Skip to content

Commit 5099113

Browse files
committed
fix: test
1 parent 7bbe8f3 commit 5099113

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/elements/content-sharing/__tests__/ContentSharingV2.test.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,12 @@ describe('elements/content-sharing/ContentSharingV2', () => {
165165
});
166166

167167
renderComponent();
168-
await waitFor(() => {
169-
expect(screen.getByRole('heading', { name: /Box Development Guide.pdf/i })).toBeVisible();
170-
});
168+
expect(await screen.findByRole('heading', { name: 'Share ‘Box Development Guide.pdf’' })).toBeVisible();
171169
});
172170

173171
test('should render UnifiedShareModal when custom config is provided', async () => {
174172
renderComponent({ config: { collaborationLimit: 3 } });
175-
await waitFor(() => {
176-
expect(screen.getByRole('heading', { name: /Box Development Guide.pdf/i })).toBeVisible();
177-
});
173+
expect(await screen.findByRole('heading', { name: 'Share ‘Box Development Guide.pdf’' })).toBeVisible();
178174
});
179175

180176
test('should allow custom config to override default config', async () => {
@@ -183,10 +179,8 @@ describe('elements/content-sharing/ContentSharingV2', () => {
183179
getFileAPI: jest.fn().mockReturnValue({ getFile: getFileMockWithSharedLink }),
184180
};
185181
renderComponent({ api: apiWithSharedLink, config: { sharedLinkEmail: true } });
186-
await waitFor(() => {
187-
expect(screen.getByRole('heading', { name: /Box Development Guide.pdf/i })).toBeVisible();
188-
expect(screen.getByRole('button', { name: 'Send Shared Link' })).toBeVisible();
189-
});
182+
expect(await screen.findByRole('heading', { name: 'Share ‘Box Development Guide.pdf’' })).toBeVisible();
183+
expect(await screen.findByRole('button', { name: 'Send Shared Link' })).toBeVisible();
190184
});
191185

192186
describe('getError function', () => {

0 commit comments

Comments
 (0)