Skip to content

Commit

Permalink
feat: tests timeout added and some tests fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mythter committed Jul 30, 2024
1 parent 5bd236e commit c67ec7a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const jestConfig: JestConfigWithTsJest = {
lines: 0.1,
},
},
testTimeout: 15_000,
};

export default jestConfig;
Expand Down
25 changes: 21 additions & 4 deletions src/features/AdminPage/PartnersPage/PartnerLink.component.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { MemoryRouter } from 'react-router-dom';
import PartnerLink from './PartnerLink.component';
import { render } from '@testing-library/react';

Expand All @@ -15,7 +16,11 @@ const svgNameCollection = ['SvgTwitterNew', 'SvgInstagram', 'SvgFacebook', 'SvgY

describe('PartnerLink', () => {
it('should render component and its elements', () => {
const { container } = render(<PartnerLink link={mockLinkProp} />);
const { container } = render(
<MemoryRouter>
<PartnerLink link={mockLinkProp} />
</MemoryRouter>,
);

const { logoType } = mockLinkProp;

Expand All @@ -35,7 +40,11 @@ describe('PartnerLink', () => {
logoType: 1,
}

const { container } = render(<PartnerLink link={newMockLinkProp} />);
const { container } = render(
<MemoryRouter>
<PartnerLink link={newMockLinkProp} />
</MemoryRouter>,
);

const { logoType } = newMockLinkProp;

Expand All @@ -51,7 +60,11 @@ describe('PartnerLink', () => {
logoType: 2,
}

const { container } = render(<PartnerLink link={newMockLinkProp} />);
const { container } = render(
<MemoryRouter>
<PartnerLink link={newMockLinkProp} />
</MemoryRouter>,
);

const { logoType } = newMockLinkProp;

Expand All @@ -67,7 +80,11 @@ describe('PartnerLink', () => {
logoType: 3,
}

const { container } = render(<PartnerLink link={newMockLinkProp} />);
const { container } = render(
<MemoryRouter>
<PartnerLink link={newMockLinkProp} />
</MemoryRouter>,
);

const { logoType } = newMockLinkProp;

Expand Down

0 comments on commit c67ec7a

Please sign in to comment.