Delay loading support chat (#10234)

There are a lot of requests being done in parallel when you load the
page, and the support chat is responsible for some of them. I don't
think it's critical to have it upon loading so delaying it by 2 seconds
This commit is contained in:
Félix Malfait
2025-02-16 12:58:20 +01:00
committed by GitHub
parent f795d90702
commit 1dca3694f7
2 changed files with 14 additions and 5 deletions

View File

@ -53,6 +53,9 @@ export const Default: Story = {
expect(await canvas.findByText('Support')).toBeInTheDocument();
await userEvent.click(canvas.getByText('Support'));
// Add delay to account for the timeout in useSupportChat
await new Promise((resolve) => setTimeout(resolve, 600));
expect(await canvas.findByText('Documentation')).toBeInTheDocument();
expect(await canvas.findByText('Talk to us')).toBeInTheDocument();
},