test: rename test and remove useless nav wrapper

This commit is contained in:
Sammy Teillet 2023-04-19 14:25:27 +02:00
parent b434f3da45
commit 97457f54cb
No known key found for this signature in database
GPG Key ID: 687E513E74D28696
2 changed files with 4 additions and 10 deletions

View File

@ -1,5 +1,3 @@
import { MemoryRouter } from 'react-router-dom';
import CompanyChip from '../CompanyChip';
import { ThemeProvider } from '@emotion/react';
import { lightTheme } from '../../../layout/styles/themes';
@ -12,9 +10,7 @@ export default {
export const RegularCompanyChip = () => {
return (
<ThemeProvider theme={lightTheme}>
<MemoryRouter initialEntries={['/companies']}>
<CompanyChip name="selected-company-1" />
</MemoryRouter>
<CompanyChip name="selected-company-1" />
</ThemeProvider>
);
};
@ -22,9 +18,7 @@ export const RegularCompanyChip = () => {
export const RegularCompanyChipWithImage = () => {
return (
<ThemeProvider theme={lightTheme}>
<MemoryRouter initialEntries={['/companies']}>
<CompanyChip name="selected-company-1" picture="coucou.fr" />
</MemoryRouter>
<CompanyChip name="selected-company-1" picture="coucou.fr" />
</ThemeProvider>
);
};

View File

@ -5,13 +5,13 @@ import {
RegularCompanyChipWithImage,
} from '../__stories__/CompanyChip';
it('Checks the NavItem renders', () => {
it('Checks the CompanyChip renders', () => {
const { getByText } = render(<RegularCompanyChip />);
expect(getByText('selected-company-1')).toBeDefined();
});
it('Checks the img renders', () => {
it('Checks the CompanyChip img renders', () => {
const { getByTestId } = render(<RegularCompanyChipWithImage />);
expect(getByTestId('company-chip-image')).toHaveAttribute('src', 'coucou.fr');