Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wix/react-native-calendars into r…
Browse files Browse the repository at this point in the history
…elease
  • Loading branch information
Inbal-Tish committed Oct 31, 2023
2 parents 95418db + 91c633e commit 47128fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"build:docs": "node ./scripts/build-docs.js",
"e2e": "node ./scripts/test-e2e.js --release",
"test": "npm run lint && npm run unit",
"test:watch": "jest --watch",
"test:perf": "TEST_RUNNER_ARGS='--testMatch **/*.perf.js' reassure measure",
"unit": "jest",
"lint": "eslint src/ example/src --ext .tsx,.ts,.js",
Expand Down
4 changes: 2 additions & 2 deletions src/expandableCalendar/__test__/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ describe('ExpandableCalendar', () => {
it.each([[Direction.LEFT],[Direction.RIGHT]])(`should call onDateChanged and onMonthChanged to next month first day when pressing the %s arrow`, (direction: Direction) => {
driver.toggleKnob();
jest.runAllTimers();
const expectedDate = today.clone().addMonths(direction === Direction.RIGHT ? 1 : -1).setDate(1);
const expectedDate = today.clone().setDate(1).addMonths(direction === Direction.RIGHT ? 1 : -1);
driver.pressOnHeaderArrow({left: direction === Direction.LEFT});
expect(onDateChanged).toHaveBeenCalledWith(toMarkingFormat(expectedDate), UpdateSources.PAGE_SCROLL);
expect(onMonthChange).toHaveBeenCalledWith(xdateToData(expectedDate), UpdateSources.PAGE_SCROLL);
Expand All @@ -208,7 +208,7 @@ describe('ExpandableCalendar', () => {
driver.pressOnHeaderArrow({left: false});
});
jest.runAllTimers();
const expectedFutureDate = today.clone().addMonths(6).setDate(1);
const expectedFutureDate = today.clone().setDate(1).addMonths(6);
expect(onDateChanged).toHaveBeenNthCalledWith(6, toMarkingFormat(expectedFutureDate), UpdateSources.PAGE_SCROLL);
expect(onMonthChange).toHaveBeenNthCalledWith(6, xdateToData(expectedFutureDate), UpdateSources.PAGE_SCROLL);
times(6, () => driver.pressOnHeaderArrow({left: true}));
Expand Down

0 comments on commit 47128fa

Please sign in to comment.