Skip to content

Commit

Permalink
test(components): fix range-date-picker spec
Browse files Browse the repository at this point in the history
  • Loading branch information
artyorsh authored Feb 6, 2020
1 parent c61f63e commit 3822af2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/components/ui/calendar/rangeCalendar.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { CalendarRange } from '@kitten/ui/calendar/type';
jest.useFakeTimers();

const now: Date = new Date();
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0);

interface State {
range: CalendarRange<Date>;
Expand Down Expand Up @@ -68,11 +67,11 @@ describe('@range-calendar: component checks', () => {

it('* range selected works properly', () => {
const expectedStartDate: Date = new Date(now.getFullYear(), now.getMonth(), 11);
const expectedEndDate: Date = new Date(now.getFullYear(), now.getMonth(), 26);
const expectedEndDate: Date = new Date(now.getFullYear(), now.getMonth(), 15);
const application: RenderAPI = render(<TestApplication/>);

fireEvent.press(application.getAllByText('11')[0]);
fireEvent.press(application.getAllByText('26')[0]);
fireEvent.press(application.getAllByText('15')[0]);
const { range } = application.getByType(RangeCalendar).props;

expect(range.startDate.toString()).toBe(expectedStartDate.toString());
Expand All @@ -84,7 +83,7 @@ describe('@range-calendar: component checks', () => {
const application: RenderAPI = render(<TestApplication/>);

fireEvent.press(application.getAllByText('11')[0]);
fireEvent.press(application.getAllByText('26')[0]);
fireEvent.press(application.getAllByText('15')[0]);
fireEvent.press(application.getAllByText('19')[0]);
const { range } = application.getByType(RangeCalendar).props;

Expand All @@ -97,7 +96,7 @@ describe('@range-calendar: component checks', () => {
const application: RenderAPI = render(<TestApplication/>);

fireEvent.press(application.getAllByText('11')[0]);
fireEvent.press(application.getAllByText('26')[0]);
fireEvent.press(application.getAllByText('15')[0]);
fireEvent.press(application.getAllByText('8')[0]);
const { range } = application.getByType(RangeCalendar).props;

Expand Down

0 comments on commit 3822af2

Please sign in to comment.