test: rename test and remove useless nav wrapper
This commit is contained in:
@ -1,5 +1,3 @@
|
|||||||
import { MemoryRouter } from 'react-router-dom';
|
|
||||||
|
|
||||||
import CompanyChip from '../CompanyChip';
|
import CompanyChip from '../CompanyChip';
|
||||||
import { ThemeProvider } from '@emotion/react';
|
import { ThemeProvider } from '@emotion/react';
|
||||||
import { lightTheme } from '../../../layout/styles/themes';
|
import { lightTheme } from '../../../layout/styles/themes';
|
||||||
@ -12,9 +10,7 @@ export default {
|
|||||||
export const RegularCompanyChip = () => {
|
export const RegularCompanyChip = () => {
|
||||||
return (
|
return (
|
||||||
<ThemeProvider theme={lightTheme}>
|
<ThemeProvider theme={lightTheme}>
|
||||||
<MemoryRouter initialEntries={['/companies']}>
|
<CompanyChip name="selected-company-1" />
|
||||||
<CompanyChip name="selected-company-1" />
|
|
||||||
</MemoryRouter>
|
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -22,9 +18,7 @@ export const RegularCompanyChip = () => {
|
|||||||
export const RegularCompanyChipWithImage = () => {
|
export const RegularCompanyChipWithImage = () => {
|
||||||
return (
|
return (
|
||||||
<ThemeProvider theme={lightTheme}>
|
<ThemeProvider theme={lightTheme}>
|
||||||
<MemoryRouter initialEntries={['/companies']}>
|
<CompanyChip name="selected-company-1" picture="coucou.fr" />
|
||||||
<CompanyChip name="selected-company-1" picture="coucou.fr" />
|
|
||||||
</MemoryRouter>
|
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -5,13 +5,13 @@ import {
|
|||||||
RegularCompanyChipWithImage,
|
RegularCompanyChipWithImage,
|
||||||
} from '../__stories__/CompanyChip';
|
} from '../__stories__/CompanyChip';
|
||||||
|
|
||||||
it('Checks the NavItem renders', () => {
|
it('Checks the CompanyChip renders', () => {
|
||||||
const { getByText } = render(<RegularCompanyChip />);
|
const { getByText } = render(<RegularCompanyChip />);
|
||||||
|
|
||||||
expect(getByText('selected-company-1')).toBeDefined();
|
expect(getByText('selected-company-1')).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Checks the img renders', () => {
|
it('Checks the CompanyChip img renders', () => {
|
||||||
const { getByTestId } = render(<RegularCompanyChipWithImage />);
|
const { getByTestId } = render(<RegularCompanyChipWithImage />);
|
||||||
|
|
||||||
expect(getByTestId('company-chip-image')).toHaveAttribute('src', 'coucou.fr');
|
expect(getByTestId('company-chip-image')).toHaveAttribute('src', 'coucou.fr');
|
||||||
|
|||||||
Reference in New Issue
Block a user