Skip to content

Commit

Permalink
fix: add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelDemey committed Dec 15, 2024
1 parent 5e5ac7f commit 315f948
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/packages/modules-operations/document/home.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
INDICATOR_CONTRIBUTOR,
SERIES_CONTRIBUTOR,
} from '../../auth/roles';
import { HomeDocument } from '../../model/operations/document';
import configureStore from '../../redux/configure-store';
import { renderWithRouter } from '../../tests-utils/render';
import DocumentHome from './home';
Expand All @@ -30,10 +31,19 @@ describe('DocumentHome', () => {
});
const { container } = renderWithRouter(
<Provider store={store}>
<DocumentHome documents={[]} />
<DocumentHome
documents={
[
{
id: '1',
},
] as unknown as HomeDocument[]
}
/>
</Provider>,
);
expect(container.querySelectorAll('ul')).toHaveLength(1);
expect(container.querySelectorAll('li')).toHaveLength(1);
});

for (const right of [ADMIN, INDICATOR_CONTRIBUTOR, SERIES_CONTRIBUTOR]) {
Expand Down

0 comments on commit 315f948

Please sign in to comment.