Skip to content

Commit

Permalink
test: update simpson based test
Browse files Browse the repository at this point in the history
  • Loading branch information
Grafikart committed Oct 5, 2023
1 parent 2efcb4c commit a114bee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/use-lunatic/use-lunatic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import useLunatic from './use-lunatic';

import sourceWithoutHierarchy from '../stories/overview/source.json';
import sourceLogement from '../stories/questionnaires/logement/source.json';
import sourceSimpsons from '../stories/questionnaires/simpsons/source.json';
import sourceSimpsons from '../stories/questionnaires2023/simpsons/source.json';
import sourceComponentSet from '../stories/component-set/source.json';
import type { LunaticData } from './type';
import { type FilledLunaticComponentProps } from './commons/fill-components/fill-components';
Expand Down Expand Up @@ -40,7 +40,7 @@ describe('use-lunatic()', () => {
const { result } = renderHook(() => useLunatic(...defaultParams));
expect(result.current.pager.page).toBe('1');
expect(result.current.pager.lastReachedPage).toBe('1');
expect(result.current.pager.maxPage).toBe('39');
expect(result.current.pager.maxPage).toBe('41');
});
it('should go to the next page correcly', () => {
const { result } = renderHook(() => useLunatic(...defaultParams));
Expand Down Expand Up @@ -217,13 +217,13 @@ describe('use-lunatic()', () => {
},
},
});
expect(Object.keys(data.COLLECTED)).toHaveLength(164);
expect(Object.keys(data.COLLECTED)).toHaveLength(109);
expect(Object.keys(data.CALCULATED)).toHaveLength(0);
});
it('should return calculated values', () => {
const data = hookRef.current.getData(true);
expect(Object.keys(data.COLLECTED)).toHaveLength(164);
expect(Object.keys(data.CALCULATED)).toHaveLength(165);
expect(Object.keys(data.COLLECTED)).toHaveLength(109);
expect(Object.keys(data.CALCULATED)).toHaveLength(33);
});
it('should only return requested variables', () => {
const data = hookRef.current.getData(false, ['COMMENT']);
Expand Down

0 comments on commit a114bee

Please sign in to comment.