Move stories and tests inside each component folders

This commit is contained in:
Charles Bochet
2022-12-05 21:56:53 +01:00
parent 92267701ff
commit 374573871c
21 changed files with 111 additions and 61 deletions

View File

@ -0,0 +1,10 @@
import { render } from '@testing-library/react';
import { InboxDefault } from '../__stories__/Inbox.stories';
it('Checks the Inbox page render', () => {
const { getAllByRole } = render(<InboxDefault />);
const button = getAllByRole('button');
expect(button[0]).toHaveTextContent('Sylvie Vartan');
});

View File

@ -0,0 +1,10 @@
import { render } from '@testing-library/react';
import { ListPanelDefault } from '../__stories__/ListPanel.stories';
it('Checks the task list render', () => {
const { getAllByRole } = render(<ListPanelDefault />);
const button = getAllByRole('button');
expect(button[0]).toHaveTextContent('Sylvie Vartan');
});

View File

@ -0,0 +1,10 @@
import { render } from '@testing-library/react';
import { ListPanelHeaderDefault } from '../__stories__/ListPanelHeader.stories';
it('Checks the ListPanelHeader render', () => {
const { getAllByText } = render(<ListPanelHeaderDefault />);
const text = getAllByText('6 tasks waiting');
expect(text).toBeDefined();
});

View File

@ -0,0 +1,10 @@
import { render } from '@testing-library/react';
import { ListPanelItemDefault } from '../__stories__/ListPanelItem.stories';
it('Checks the ListPanelItem render', () => {
const { getAllByText } = render(<ListPanelItemDefault />);
const text = getAllByText('Sylvie Vartan');
expect(text).toBeDefined();
});