Fix chromatic pixel tests

This commit is contained in:
Charles Bochet
2024-07-19 19:42:04 +02:00
parent b64e8096d6
commit cac0d22285

View File

@ -1,7 +1,7 @@
import { expect } from '@storybook/jest';
import { Meta, StoryObj } from '@storybook/react';
import { within } from '@storybook/test';
import { graphql, HttpResponse } from 'msw';
import { HttpResponse, graphql } from 'msw';
import {
PageDecorator,
@ -90,7 +90,11 @@ export const Default: Story = {
await canvas.findAllByText(
peopleMock[0].name.firstName + ' ' + peopleMock[0].name.lastName,
);
await canvas.findByText('Add your first Activity');
expect(
await canvas.findByText('Add your first Activity', undefined, {
timeout: 3000,
}),
).toBeInTheDocument();
},
};
@ -106,6 +110,11 @@ export const Loading: Story = {
peopleMock[0].name.firstName + ' ' + peopleMock[0].name.lastName,
),
).toBeNull();
expect(canvas.queryByText('Add your first Activity')).toBeNull();
expect(
await canvas.findByText('Add your first Activity', undefined, {
timeout: 3000,
}),
).toBeInTheDocument();
},
};