@ -1,28 +1,24 @@ | |||||
const { scrollWheel, expectDate } = require("../../utils") | |||||
const { scrollWheel, expectDate } = require('../../utils') | |||||
describe('Hour wheel', () => { | describe('Hour wheel', () => { | ||||
before(async () => { | |||||
await device.reloadReactNative() | |||||
await element(by.text('Advanced')).tap() | |||||
}) | |||||
before(async () => { | |||||
await device.reloadReactNative() | |||||
await element(by.text('Advanced')).tap() | |||||
}) | |||||
it('should have 24 hours', async () => { | |||||
await scroll3HoursAndExpect("2000-01-01 03:00:00") | |||||
await scroll3HoursAndExpect("2000-01-01 06:00:00") | |||||
await scroll3HoursAndExpect("2000-01-01 09:00:00") | |||||
await scroll3HoursAndExpect("2000-01-01 12:00:00") | |||||
await scroll3HoursAndExpect("2000-01-01 15:00:00") | |||||
await scroll3HoursAndExpect("2000-01-01 18:00:00") | |||||
await scroll3HoursAndExpect("2000-01-01 21:00:00") | |||||
await scroll3HoursAndExpect("2000-01-01 00:00:00") | |||||
}) | |||||
const scroll3HoursAndExpect = async (date) => { | |||||
await scrollWheel(1, 3) | |||||
await expectDate(date) | |||||
} | |||||
it('should have 24 hours', async () => { | |||||
await scroll3HoursAndExpect('2000-01-01 03:00:00') | |||||
await scroll3HoursAndExpect('2000-01-01 06:00:00') | |||||
await scroll3HoursAndExpect('2000-01-01 09:00:00') | |||||
await scroll3HoursAndExpect('2000-01-01 12:00:00') | |||||
await scroll3HoursAndExpect('2000-01-01 15:00:00') | |||||
await scroll3HoursAndExpect('2000-01-01 18:00:00') | |||||
await scroll3HoursAndExpect('2000-01-01 21:00:00') | |||||
await scroll3HoursAndExpect('2000-01-01 00:00:00') | |||||
}) | |||||
const scroll3HoursAndExpect = async date => { | |||||
await scrollWheel(1, 3) | |||||
await expectDate(date) | |||||
} | |||||
}) | }) | ||||
@ -1,49 +1,47 @@ | |||||
const { setMode } = require("../../utils";) | |||||
const { setMode } = require('../../utils';) | |||||
describe('Modes - 24h', () => { | describe('Modes - 24h', () => { | ||||
before(async () => { | |||||
await device.reloadReactNative() | |||||
await element(by.text('Advanced')).tap() | |||||
}) | |||||
it('datetime', async () => { | |||||
await setMode("datetime") | |||||
await expect(element(by.id('day'))).toBeVisible() | |||||
await expect(element(by.id('minutes'))).toBeVisible() | |||||
await expect(element(by.id('hour'))).toBeVisible() | |||||
await expect(element(by.id('ampm'))).toNotExist() | |||||
await expect(element(by.id('month'))).toNotExist() | |||||
await expect(element(by.id('date'))).toNotExist() | |||||
await expect(element(by.id('year'))).toNotExist() | |||||
}) | |||||
it('date', async () => { | |||||
await setMode("date") | |||||
await expect(element(by.id('month'))).toBeVisible() | |||||
await expect(element(by.id('date'))).toBeVisible() | |||||
await expect(element(by.id('year'))).toBeVisible() | |||||
await expect(element(by.id('day'))).toNotExist() | |||||
await expect(element(by.id('minutes'))).toNotExist() | |||||
await expect(element(by.id('hour'))).toNotExist() | |||||
await expect(element(by.id('ampm'))).toNotExist() | |||||
}) | |||||
it('time', async () => { | |||||
await setMode("time") | |||||
await expect(element(by.id('minutes'))).toBeVisible() | |||||
await expect(element(by.id('hour'))).toBeVisible() | |||||
await expect(element(by.id('ampm'))).toNotExist() | |||||
await expect(element(by.id('day'))).toNotExist() | |||||
await expect(element(by.id('month'))).toNotExist() | |||||
await expect(element(by.id('date'))).toNotExist() | |||||
await expect(element(by.id('year'))).toNotExist() | |||||
}) | |||||
before(async () => { | |||||
await device.reloadReactNative() | |||||
await element(by.text('Advanced')).tap() | |||||
}) | |||||
it('datetime', async () => { | |||||
await setMode('datetime') | |||||
await expect(element(by.id('day'))).toBeVisible() | |||||
await expect(element(by.id('minutes'))).toBeVisible() | |||||
await expect(element(by.id('hour'))).toBeVisible() | |||||
await expect(element(by.id('ampm'))).toNotExist() | |||||
await expect(element(by.id('month'))).toNotExist() | |||||
await expect(element(by.id('date'))).toNotExist() | |||||
await expect(element(by.id('year'))).toNotExist() | |||||
}) | |||||
it('date', async () => { | |||||
await setMode('date') | |||||
await expect(element(by.id('month'))).toBeVisible() | |||||
await expect(element(by.id('date'))).toBeVisible() | |||||
await expect(element(by.id('year'))).toBeVisible() | |||||
await expect(element(by.id('day'))).toNotExist() | |||||
await expect(element(by.id('minutes'))).toNotExist() | |||||
await expect(element(by.id('hour'))).toNotExist() | |||||
await expect(element(by.id('ampm'))).toNotExist() | |||||
}) | |||||
it('time', async () => { | |||||
await setMode('time') | |||||
await expect(element(by.id('minutes'))).toBeVisible() | |||||
await expect(element(by.id('hour'))).toBeVisible() | |||||
await expect(element(by.id('ampm'))).toNotExist() | |||||
await expect(element(by.id('day'))).toNotExist() | |||||
await expect(element(by.id('month'))).toNotExist() | |||||
await expect(element(by.id('date'))).toNotExist() | |||||
await expect(element(by.id('year'))).toNotExist() | |||||
}) | |||||
}) | }) |
@ -1,131 +1,116 @@ | |||||
const { scrollWheel, expectDate, setMaximumDate, setMode } = require("../utils";) | |||||
const { scrollWheel, expectDate, setMaximumDate, setMode } = require('../utils';) | |||||
const initialDate = new Date(2000, 0, 1, 0, 0); | |||||
const secondOfJanuary = new Date(2000, 0, 2, 0, 0); | |||||
const secondOfJanuary2001 = new Date(2001, 0, 2, 0, 0); | |||||
const initialDate = new Date(2000, 0, 1, 0, 0) | |||||
const secondOfJanuary = new Date(2000, 0, 2, 0, 0) | |||||
const secondOfJanuary2001 = new Date(2001, 0, 2, 0, 0) | |||||
describe('Maximum date', () => { | describe('Maximum date', () => { | ||||
before(async () => { | |||||
await device.reloadReactNative() | |||||
await element(by.text('Advanced')).tap() | |||||
}) | |||||
describe('cannot pass max date - datetime mode', () => { | |||||
before(async () => { | before(async () => { | ||||
await device.reloadReactNative() | |||||
await element(by.text('Advanced')).tap() | |||||
await setMode('datetime') | |||||
await setMaximumDate(initialDate) | |||||
}) | }) | ||||
describe('cannot pass max date - datetime mode', () => { | |||||
before(async () => { | |||||
await setMode("datetime") | |||||
await setMaximumDate(initialDate) | |||||
}) | |||||
it('day wheel', async () => { | |||||
await scrollWheel(0, 2) | |||||
await expectDate("2000-01-01 00:00:00") | |||||
}) | |||||
it('hour wheel', async () => { | |||||
await scrollWheel(1, 1) | |||||
await expectDate("2000-01-01 00:00:00") | |||||
}) | |||||
it('minute wheel', async () => { | |||||
await scrollWheel(2, 1) | |||||
await expectDate("2000-01-01 00:00:00") | |||||
}) | |||||
it('day wheel', async () => { | |||||
await scrollWheel(0, 2) | |||||
await expectDate('2000-01-01 00:00:00') | |||||
}) | }) | ||||
describe('cannot pass max date - date mode', () => { | |||||
before(async () => { | |||||
await setMode("date") | |||||
await setMaximumDate(initialDate) | |||||
}) | |||||
it('month wheel', async () => { | |||||
await scrollWheel(0, 1) | |||||
await expectDate("2000-01-01 00:00:00") | |||||
}) | |||||
it('date wheel', async () => { | |||||
await scrollWheel(1, 1) | |||||
await expectDate("2000-01-01 00:00:00") | |||||
}) | |||||
it('year wheel', async () => { | |||||
await scrollWheel(2, 1) | |||||
await expectDate("2000-01-01 00:00:00") | |||||
}) | |||||
it('hour wheel', async () => { | |||||
await scrollWheel(1, 1) | |||||
await expectDate('2000-01-01 00:00:00') | |||||
}) | }) | ||||
it('minute wheel', async () => { | |||||
await scrollWheel(2, 1) | |||||
await expectDate('2000-01-01 00:00:00') | |||||
}) | |||||
}) | |||||
describe('overshooting max date', () => { | |||||
before(async () => { | |||||
await setMaximumDate(secondOfJanuary) | |||||
}) | |||||
it('day wheel should not be possible to overshoot since it is not wrapping (no invalid dates exists)', async () => { | |||||
await setMode("datetime") | |||||
await scrollWheel(0, 1) | |||||
await expectDate("2000-01-02 00:00:00") | |||||
await scrollWheel(0, 1) | |||||
await expectDate("2000-01-02 00:00:00") | |||||
}) | |||||
describe('date mode', () => { | |||||
before(async () => { | |||||
await setMode("date") | |||||
await setMaximumDate(secondOfJanuary) | |||||
}) | |||||
it('overshooting month wheel should set all other wheels to maximum possible date', async () => { | |||||
await scrollWheel(0, 1) | |||||
await expectDate("2000-01-02 00:00:00") | |||||
}) | |||||
it('overshooting date wheel should reverse to highest possible date', async () => { | |||||
await scrollWheel(1, 5) | |||||
await expectDate("2000-01-02 00:00:00") | |||||
}) | |||||
it('overshooting year wheel should set all other wheels to maximum possible date', async () => { | |||||
await setMaximumDate(secondOfJanuary2001) | |||||
await scrollWheel(0, 1) // set month to feb | |||||
await scrollWheel(2, 1) | |||||
await expectDate("2001-01-02 00:00:00") | |||||
}) | |||||
}) | |||||
describe('time mode', () => { | |||||
before(async () => { | |||||
await setMode("time") | |||||
await setMaximumDate(initialDate) | |||||
}) | |||||
it('overshooting hour wheel should reverse to highest possible time', async () => { | |||||
await scrollWheel(0, 5) | |||||
await expectDate("2000-01-01 00:00:00") | |||||
}) | |||||
describe('cannot pass max date - date mode', () => { | |||||
before(async () => { | |||||
await setMode('date') | |||||
await setMaximumDate(initialDate) | |||||
}) | |||||
it('overshooting minute wheel should reverse to highest possible time', async () => { | |||||
await scrollWheel(1, 5) | |||||
await expectDate("2000-01-01 00:00:00";) | |||||
}) | |||||
it('month wheel', async () => { | |||||
await scrollWheel(0, 1) | |||||
await expectDate('2000-01-01 00:00:00') | |||||
}) | |||||
it('overshooting am/pm wheel should reverse to highest possible time', async () => { | |||||
await scrollWheel(2, 1) | |||||
await expectDate("2000-01-01 00:00:00";) | |||||
}) | |||||
it('date wheel', async () => { | |||||
await scrollWheel(1, 1) | |||||
await expectDate('2000-01-01 00:00:00') | |||||
}) | |||||
}) | |||||
it('year wheel', async () => { | |||||
await scrollWheel(2, 1) | |||||
await expectDate('2000-01-01 00:00:00') | |||||
}) | |||||
}) | |||||
describe('overshooting max date', () => { | |||||
before(async () => { | |||||
await setMaximumDate(secondOfJanuary) | |||||
}) | |||||
it('day wheel should not be possible to overshoot since it is not wrapping (no invalid dates exists)', async () => { | |||||
await setMode('datetime') | |||||
await scrollWheel(0, 1) | |||||
await expectDate('2000-01-02 00:00:00') | |||||
await scrollWheel(0, 1) | |||||
await expectDate('2000-01-02 00:00:00') | |||||
}) | |||||
describe('date mode', () => { | |||||
before(async () => { | |||||
await setMode('date') | |||||
await setMaximumDate(secondOfJanuary) | |||||
}) | |||||
it('overshooting month wheel should set all other wheels to maximum possible date', async () => { | |||||
await scrollWheel(0, 1) | |||||
await expectDate('2000-01-02 00:00:00') | |||||
}) | |||||
it('overshooting date wheel should reverse to highest possible date', async () => { | |||||
await scrollWheel(1, 5) | |||||
await expectDate('2000-01-02 00:00:00') | |||||
}) | |||||
it('overshooting year wheel should set all other wheels to maximum possible date', async () => { | |||||
await setMaximumDate(secondOfJanuary2001) | |||||
await scrollWheel(0, 1) // set month to feb | |||||
await scrollWheel(2, 1) | |||||
await expectDate('2001-01-02 00:00:00') | |||||
}) | |||||
}) | }) | ||||
}) | |||||
describe('time mode', () => { | |||||
before(async () => { | |||||
await setMode('time') | |||||
await setMaximumDate(initialDate) | |||||
}) | |||||
it('overshooting hour wheel should reverse to highest possible time', async () => { | |||||
await scrollWheel(0, 5) | |||||
await expectDate('2000-01-01 00:00:00') | |||||
}) | |||||
it('overshooting minute wheel should reverse to highest possible time', async () => { | |||||
await scrollWheel(1, 5) | |||||
await expectDate('2000-01-01 00:00:00') | |||||
}) | |||||
it('overshooting am/pm wheel should reverse to highest possible time', async () => { | |||||
await scrollWheel(2, 1) | |||||
await expectDate('2000-01-01 00:00:00') | |||||
}) | |||||
}) | |||||
}) | |||||
}) |
@ -1,134 +1,123 @@ | |||||
const { setDate, scrollWheel, expectDate, setMinimumDate, setMode } = require("../utils") | |||||
const { | |||||
setDate, | |||||
scrollWheel, | |||||
expectDate, | |||||
setMinimumDate, | |||||
setMode, | |||||
} = require('../utils') | |||||
const oneMinuteBeforeJanuary2 = new Date(2000, 0, 1, 23, 59, 0); | |||||
const oneMinuteBeforeJanuary2 = new Date(2000, 0, 1, 23, 59, 0) | |||||
describe('Minimum date', () => { | describe('Minimum date', () => { | ||||
before(async () => { | |||||
await device.reloadReactNative() | |||||
await element(by.text('Advanced')).tap() | |||||
before(async () => { | |||||
await device.reloadReactNative() | |||||
await element(by.text('Advanced')).tap() | |||||
}) | |||||
beforeEach(async () => { | |||||
await setDate(oneMinuteBeforeJanuary2.toISOString()) | |||||
}) | |||||
describe('cannot pass min date - mode: ', () => { | |||||
describe('datetime', () => { | |||||
before(async () => { | |||||
await setMode('datetime') | |||||
await setMinimumDate(oneMinuteBeforeJanuary2) | |||||
}) | |||||
it('day wheel', async () => { | |||||
await scrollWheel(0, -2) | |||||
await expectDate('2000-01-01 23:59:00') | |||||
}) | |||||
it('hour wheel', async () => { | |||||
await scrollWheel(1, -1) | |||||
await expectDate('2000-01-01 23:59:00') | |||||
}) | |||||
it('minute wheel', async () => { | |||||
await scrollWheel(2, -1) | |||||
await expectDate('2000-01-01 23:59:00') | |||||
}) | |||||
}) | }) | ||||
beforeEach(async () => { | |||||
await setDate(oneMinuteBeforeJanuary2.toISOString()) | |||||
describe('date', () => { | |||||
before(async () => { | |||||
await setMode('date') | |||||
await setMinimumDate(oneMinuteBeforeJanuary2) | |||||
}) | |||||
it('month wheel', async () => { | |||||
await scrollWheel(0, -1) | |||||
await expectDate('2000-01-06 00:00:00') | |||||
}) | |||||
it('date wheel', async () => { | |||||
await scrollWheel(1, -1) | |||||
await expectDate('2000-01-06 00:00:00') | |||||
}) | |||||
it('year wheel', async () => { | |||||
await scrollWheel(2, -1) | |||||
await expectDate('2000-01-01 23:59:00') | |||||
}) | |||||
}) | }) | ||||
}) | |||||
describe('cannot pass min date - mode: ', () => { | |||||
describe('datetime', () => { | |||||
before(async () => { | |||||
await setMode("datetime") | |||||
await setMinimumDate(oneMinuteBeforeJanuary2) | |||||
}) | |||||
it('day wheel', async () => { | |||||
await scrollWheel(0, -2) | |||||
await expectDate("2000-01-01 23:59:00") | |||||
}) | |||||
it('hour wheel', async () => { | |||||
await scrollWheel(1, -1) | |||||
await expectDate("2000-01-01 23:59:00") | |||||
}) | |||||
it('minute wheel', async () => { | |||||
await scrollWheel(2, -1) | |||||
await expectDate("2000-01-01 23:59:00") | |||||
}) | |||||
}) | |||||
describe('date', () => { | |||||
before(async () => { | |||||
await setMode("date") | |||||
await setMinimumDate(oneMinuteBeforeJanuary2) | |||||
}) | |||||
it('month wheel', async () => { | |||||
await scrollWheel(0, -1) | |||||
await expectDate("2000-01-01 23:59:00") | |||||
}) | |||||
it('date wheel', async () => { | |||||
await scrollWheel(1, -1) | |||||
await expectDate("2000-01-01 23:59:00") | |||||
}) | |||||
it('year wheel', async () => { | |||||
await scrollWheel(2, -1) | |||||
await expectDate("2000-01-01 23:59:00") | |||||
}) | |||||
}) | |||||
describe('overshooting min date - mode:', () => { | |||||
before(async () => { | |||||
await setMinimumDate(oneMinuteBeforeJanuary2) | |||||
}) | }) | ||||
describe('datetime', () => { | |||||
before(async () => { | |||||
await setMode('datetime') | |||||
}) | |||||
it('day wheel should not be possible to overshoot since it is not wrapping (no invalid dates exists)', async () => { | |||||
await scrollWheel(0, -1) | |||||
await expectDate('2000-01-01 23:59:00') | |||||
await scrollWheel(0, -1) | |||||
await expectDate('2000-01-01 23:59:00') | |||||
}) | |||||
}) | |||||
describe('overshooting min date - mode:', () => { | |||||
before(async () => { | |||||
await setMinimumDate(oneMinuteBeforeJanuary2) | |||||
}) | |||||
describe('datetime', () => { | |||||
before(async () => { | |||||
await setMode("datetime") | |||||
}) | |||||
it('day wheel should not be possible to overshoot since it is not wrapping (no invalid dates exists)', async () => { | |||||
await scrollWheel(0, -1) | |||||
await expectDate("2000-01-01 23:59:00") | |||||
await scrollWheel(0, -1) | |||||
await expectDate("2000-01-01 23:59:00") | |||||
}) | |||||
}) | |||||
describe('date', () => { | |||||
before(async () => { | |||||
await setMode("date") | |||||
}) | |||||
it('overshooting month wheel should set all other wheels to minimum possible date', async () => { | |||||
await scrollWheel(0, -1) | |||||
await expectDate("2000-01-01 23:59:00") | |||||
}) | |||||
it('overshooting date wheel should reverse to minimum possible date', async () => { | |||||
await scrollWheel(1, -5) | |||||
await expectDate("2000-01-01 23:59:00") | |||||
}) | |||||
}) | |||||
describe('time mode', () => { | |||||
before(async () => { | |||||
await setMode("time") | |||||
await setMinimumDate(oneMinuteBeforeJanuary2) | |||||
}) | |||||
it('overshooting hour wheel should reverse to minimum possible time', async () => { | |||||
await scrollWheel(0, -5) | |||||
await expectDate("2000-01-01 23:59:00") | |||||
}) | |||||
it('overshooting minute wheel should reverse to minimum possible time', async () => { | |||||
await scrollWheel(1, -5) | |||||
await expectDate("2000-01-01 23:59:00") | |||||
}) | |||||
it('overshooting am/pm wheel should reverse to minimum possible time', async () => { | |||||
await scrollWheel(2, -1) | |||||
await expectDate("2000-01-01 23:59:00") | |||||
}) | |||||
}) | |||||
describe('date', () => { | |||||
before(async () => { | |||||
await setMode('date') | |||||
}) | |||||
it('overshooting month wheel should set all other wheels to maximum possible date', async () => { | |||||
await scrollWheel(0, -1) | |||||
await expectDate('2000-01-06 00:00:00') | |||||
}) | |||||
it('overshooting date wheel should reverse to maximum possible date', async () => { | |||||
await scrollWheel(1, -5) | |||||
await expectDate('2000-01-06 00:00:00') | |||||
}) | |||||
}) | }) | ||||
}) | |||||
describe('time mode', () => { | |||||
before(async () => { | |||||
await setMode('time') | |||||
await setMinimumDate(oneMinuteBeforeJanuary2) | |||||
}) | |||||
it('overshooting hour wheel should reverse to minimum possible time', async () => { | |||||
await scrollWheel(0, -5) | |||||
await expectDate('2000-01-01 23:59:00') | |||||
}) | |||||
it('overshooting minute wheel should reverse to minimum possible time', async () => { | |||||
await scrollWheel(1, -5) | |||||
await expectDate('2000-01-01 23:59:00') | |||||
}) | |||||
it('overshooting am/pm wheel should reverse to minimum possible time', async () => { | |||||
await scrollWheel(2, -1) | |||||
await expectDate('2000-01-01 23:59:00') | |||||
}) | |||||
}) | |||||
}) | |||||
}) |
@ -1,34 +1,32 @@ | |||||
const { scrollWheel, expectDate, setMinuteInterval } = require("../utils";) | |||||
const { scrollWheel, expectDate, setMinuteInterval } = require('../utils';) | |||||
const scrollMinuteWheel = () => scrollWheel(2, 1) | const scrollMinuteWheel = () => scrollWheel(2, 1) | ||||
describe('Minute interval', () => { | describe('Minute interval', () => { | ||||
before(async () => { | |||||
await device.reloadReactNative() | |||||
await element(by.text('Advanced')).tap() | |||||
}) | |||||
before(async () => { | |||||
await device.reloadReactNative() | |||||
await element(by.text('Advanced')).tap() | |||||
}) | |||||
it('1 minute (default)', async () => { | |||||
await setMinuteInterval(1) | |||||
await scrollMinuteWheel() | |||||
await expectDate('2000-01-01 00:01:00') | |||||
}) | |||||
it('1 minute (default)', async () => { | |||||
await setMinuteInterval(1) | |||||
await scrollMinuteWheel() | |||||
await expectDate("2000-01-01 00:01:00";) | |||||
}) | |||||
it('5 minutes', async () => { | |||||
await setMinuteInterval(5) | |||||
await scrollMinuteWheel() | |||||
await expectDate('2000-01-01 00:05:00';) | |||||
}) | |||||
it('5 minutes', async () => { | |||||
await setMinuteInterval(5) | |||||
await scrollMinuteWheel() | |||||
await expectDate("2000-01-01 00:05:00") | |||||
}) | |||||
it('15 minutes', async () => { | |||||
await setMinuteInterval(15) | |||||
await scrollMinuteWheel() | |||||
await expectDate("2000-01-01 00:15:00") | |||||
await scrollMinuteWheel() | |||||
await expectDate("2000-01-01 00:30:00") | |||||
await scrollMinuteWheel() | |||||
await expectDate("2000-01-01 00:45:00") | |||||
}) | |||||
}) | |||||
it('15 minutes', async () => { | |||||
await setMinuteInterval(15) | |||||
await scrollMinuteWheel() | |||||
await expectDate('2000-01-01 00:15:00') | |||||
await scrollMinuteWheel() | |||||
await expectDate('2000-01-01 00:30:00') | |||||
await scrollMinuteWheel() | |||||
await expectDate('2000-01-01 00:45:00') | |||||
}) | |||||
}) |
@ -1,45 +1,41 @@ | |||||
const { scrollWheel, expectDate } = require("../utils") | |||||
const { scrollWheel, expectDate } = require('../utils') | |||||
describe('Scroll around', () => { | describe('Scroll around', () => { | ||||
before(async () => { | |||||
await device.reloadReactNative() | |||||
await element(by.text('Advanced')).tap() | |||||
}) | |||||
it.skip('Hour wheel should scroll all way around and switch AM/PM when passing 12', async () => { | |||||
await scroll3HoursAndExpect("2000-01-01 03:00:00") | |||||
await scroll3HoursAndExpect("2000-01-01 06:00:00") | |||||
await scroll3HoursAndExpect("2000-01-01 09:00:00") | |||||
await scrollWheel(1, 2) | |||||
await expectDate("2000-01-01 11:00:00") | |||||
await scrollWheel(1, 2) | |||||
await expectDate("2000-01-01 13:00:00") | |||||
await scroll3HoursAndExpect("2000-01-01 16:00:00") | |||||
await scroll3HoursAndExpect("2000-01-01 19:00:00") | |||||
await scroll3HoursAndExpect("2000-01-01 22:00:00") | |||||
await scroll3HoursAndExpect("2000-01-01 01:00:00") | |||||
}) | |||||
it('Minute wheel should be possible to scroll all way around', async () => { | |||||
await scrollWheel(2, 55) | |||||
await expectDate("2000-01-01 00:55:00") | |||||
await scrollWheel(2, 10) | |||||
await expectDate("2000-01-01 00:05:00") | |||||
}) | |||||
it('Day wheel should change year when passing new year', async () => { | |||||
await scrollWheel(0, -1) | |||||
await expectDate("1999-12-31 00:00:00") | |||||
await scrollWheel(0, 1) | |||||
await expectDate("2000-01-01 00:00:00") | |||||
}) | |||||
const scroll3HoursAndExpect = async (date) => { | |||||
await scrollWheel(1, 3) | |||||
await expectDate(date) | |||||
} | |||||
before(async () => { | |||||
await device.reloadReactNative() | |||||
await element(by.text('Advanced')).tap() | |||||
}) | |||||
it.skip('Hour wheel should scroll all way around and switch AM/PM when passing 12', async () => { | |||||
await scroll3HoursAndExpect('2000-01-01 03:00:00') | |||||
await scroll3HoursAndExpect('2000-01-01 06:00:00') | |||||
await scroll3HoursAndExpect('2000-01-01 09:00:00') | |||||
await scrollWheel(1, 2) | |||||
await expectDate('2000-01-01 11:00:00') | |||||
await scrollWheel(1, 2) | |||||
await expectDate('2000-01-01 13:00:00') | |||||
await scroll3HoursAndExpect('2000-01-01 16:00:00') | |||||
await scroll3HoursAndExpect('2000-01-01 19:00:00') | |||||
await scroll3HoursAndExpect('2000-01-01 22:00:00') | |||||
await scroll3HoursAndExpect('2000-01-01 01:00:00') | |||||
}) | |||||
it('Minute wheel should be possible to scroll all way around', async () => { | |||||
await scrollWheel(2, 55) | |||||
await expectDate('2000-01-01 00:55:00') | |||||
await scrollWheel(2, 10) | |||||
await expectDate('2000-01-01 00:05:00') | |||||
}) | |||||
it('Day wheel should change year when passing new year', async () => { | |||||
await scrollWheel(0, -1) | |||||
await expectDate('1999-12-31 00:00:00') | |||||
await scrollWheel(0, 1) | |||||
await expectDate('2000-01-01 00:00:00') | |||||
}) | |||||
const scroll3HoursAndExpect = async date => { | |||||
await scrollWheel(1, 3) | |||||
await expectDate(date) | |||||
} | |||||
}) | }) | ||||
@ -1,95 +1,90 @@ | |||||
const { scrollWheelWithIndexAndExpectDate, setMode, setLocale, setMaximumDate } = require("../utils") | |||||
const { | |||||
scrollWheelWithIndexAndExpectDate, | |||||
setMode, | |||||
setLocale, | |||||
setMaximumDate, | |||||
} = require('../utils') | |||||
describe('Wheel order', () => { | describe('Wheel order', () => { | ||||
before(async () => { | before(async () => { | ||||
await device.reloadReactNative() | await device.reloadReactNative() | ||||
await element(by.text('Advanced')).tap() | await element(by.text('Advanced')).tap() | ||||
await setMaximumDate("undefined";) | |||||
await setMaximumDate('undefined';) | |||||
}) | }) | ||||
describe('datetime', () => { | describe('datetime', () => { | ||||
before(async () => { | before(async () => { | ||||
await setMode("datetime";) | |||||
await setMode('datetime';) | |||||
}) | }) | ||||
it('US', async () => { | it('US', async () => { | ||||
await setLocale("en-US";) | |||||
await scrollWheelWithIndexAndExpectDate(0, "2000-01-02 00:00:00";) | |||||
await scrollWheelWithIndexAndExpectDate(1, "2000-01-01 01:00:00";) | |||||
await scrollWheelWithIndexAndExpectDate(2, "2000-01-01 00:01:00";) | |||||
await scrollWheelWithIndexAndExpectDate(3, "2000-01-01 12:00:00";) | |||||
await setLocale('en-US';) | |||||
await scrollWheelWithIndexAndExpectDate(0, '2000-01-02 00:00:00';) | |||||
await scrollWheelWithIndexAndExpectDate(1, '2000-01-01 01:00:00';) | |||||
await scrollWheelWithIndexAndExpectDate(2, '2000-01-01 00:01:00';) | |||||
await scrollWheelWithIndexAndExpectDate(3, '2000-01-01 12:00:00';) | |||||
}) | }) | ||||
it('Korean', async () => { | it('Korean', async () => { | ||||
await setLocale("ko-KR";) | |||||
await scrollWheelWithIndexAndExpectDate(0, "2000-01-02 00:00:00";) | |||||
await scrollWheelWithIndexAndExpectDate(1, "2000-01-01 12:00:00";) | |||||
await scrollWheelWithIndexAndExpectDate(2, "2000-01-01 01:00:00";) | |||||
await scrollWheelWithIndexAndExpectDate(3, "2000-01-01 00:01:00";) | |||||
await setLocale('ko-KR';) | |||||
await scrollWheelWithIndexAndExpectDate(0, '2000-01-02 00:00:00';) | |||||
await scrollWheelWithIndexAndExpectDate(1, '2000-01-01 12:00:00';) | |||||
await scrollWheelWithIndexAndExpectDate(2, '2000-01-01 01:00:00';) | |||||
await scrollWheelWithIndexAndExpectDate(3, '2000-01-01 00:01:00';) | |||||
}) | }) | ||||
}) | }) | ||||
describe('date', () => { | describe('date', () => { | ||||
before(async () => { | before(async () => { | ||||
await setMode("date";) | |||||
await setMode('date';) | |||||
}) | }) | ||||
it('US', async () => { | it('US', async () => { | ||||
await setLocale("en-US";) | |||||
await scrollWheelWithIndexAndExpectDate(0, "2000-02-01 00:00:00";) | |||||
await scrollWheelWithIndexAndExpectDate(1, "2000-01-02 00:00:00";) | |||||
await scrollWheelWithIndexAndExpectDate(2, "2001-01-01 00:00:00";) | |||||
await setLocale('en-US';) | |||||
await scrollWheelWithIndexAndExpectDate(0, '2000-02-01 00:00:00';) | |||||
await scrollWheelWithIndexAndExpectDate(1, '2000-01-02 00:00:00';) | |||||
await scrollWheelWithIndexAndExpectDate(2, '2001-01-01 00:00:00';) | |||||
}) | }) | ||||
it('UK', async () => { | it('UK', async () => { | ||||
await setLocale("en-GB";) | |||||
await scrollWheelWithIndexAndExpectDate(0, "2000-01-02 00:00:00";) | |||||
await scrollWheelWithIndexAndExpectDate(1, "2000-02-01 00:00:00";) | |||||
await scrollWheelWithIndexAndExpectDate(2, "2001-01-01 00:00:00";) | |||||
await setLocale('en-GB';) | |||||
await scrollWheelWithIndexAndExpectDate(0, '2000-01-02 00:00:00';) | |||||
await scrollWheelWithIndexAndExpectDate(1, '2000-02-01 00:00:00';) | |||||
await scrollWheelWithIndexAndExpectDate(2, '2001-01-01 00:00:00';) | |||||
}) | }) | ||||
it('Korean', async () => { | it('Korean', async () => { | ||||
await setLocale("ko-KR";) | |||||
await scrollWheelWithIndexAndExpectDate(0, "2001-01-01 00:00:00";) | |||||
await scrollWheelWithIndexAndExpectDate(1, "2000-02-01 00:00:00";) | |||||
await scrollWheelWithIndexAndExpectDate(2, "2000-01-02 00:00:00";) | |||||
await setLocale('ko-KR';) | |||||
await scrollWheelWithIndexAndExpectDate(0, '2001-01-01 00:00:00';) | |||||
await scrollWheelWithIndexAndExpectDate(1, '2000-02-01 00:00:00';) | |||||
await scrollWheelWithIndexAndExpectDate(2, '2000-01-02 00:00:00';) | |||||
}) | }) | ||||
}) | }) | ||||
describe('time', () => { | describe('time', () => { | ||||
before(async () => { | before(async () => { | ||||
await setMode("time";) | |||||
await setMode('time';) | |||||
}) | }) | ||||
it('US', async () => { | it('US', async () => { | ||||
await setLocale("en-US";) | |||||
await scrollWheelWithIndexAndExpectDate(0, "2000-01-01 01:00:00";) | |||||
await scrollWheelWithIndexAndExpectDate(1, "2000-01-01 00:01:00";) | |||||
await scrollWheelWithIndexAndExpectDate(2, "2000-01-01 12:00:00";) | |||||
await setLocale('en-US';) | |||||
await scrollWheelWithIndexAndExpectDate(0, '2000-01-01 01:00:00';) | |||||
await scrollWheelWithIndexAndExpectDate(1, '2000-01-01 00:01:00';) | |||||
await scrollWheelWithIndexAndExpectDate(2, '2000-01-01 12:00:00';) | |||||
}) | }) | ||||
it('UK', async () => { | it('UK', async () => { | ||||
await setLocale("en-GB";) | |||||
await scrollWheelWithIndexAndExpectDate(0, "2000-01-01 01:00:00";) | |||||
await scrollWheelWithIndexAndExpectDate(1, "2000-01-01 00:01:00";) | |||||
await scrollWheelWithIndexAndExpectDate(2, "2000-01-01 12:00:00";) | |||||
await setLocale('en-GB';) | |||||
await scrollWheelWithIndexAndExpectDate(0, '2000-01-01 01:00:00';) | |||||
await scrollWheelWithIndexAndExpectDate(1, '2000-01-01 00:01:00';) | |||||
await scrollWheelWithIndexAndExpectDate(2, '2000-01-01 12:00:00';) | |||||
}) | }) | ||||
it('Korean', async () => { | it('Korean', async () => { | ||||
await setLocale("ko-KR";) | |||||
await scrollWheelWithIndexAndExpectDate(0, "2000-01-01 12:00:00";) | |||||
await scrollWheelWithIndexAndExpectDate(1, "2000-01-01 01:00:00";) | |||||
await scrollWheelWithIndexAndExpectDate(2, "2000-01-01 00:01:00";) | |||||
await setLocale('ko-KR';) | |||||
await scrollWheelWithIndexAndExpectDate(0, '2000-01-01 12:00:00';) | |||||
await scrollWheelWithIndexAndExpectDate(1, '2000-01-01 01:00:00';) | |||||
await scrollWheelWithIndexAndExpectDate(2, '2000-01-01 00:01:00';) | |||||
}) | }) | ||||
}) | }) | ||||
}) | }) |