Skip to content

Commit

Permalink
test: Disable tests for calendar swiping feature
Browse files Browse the repository at this point in the history
  • Loading branch information
motss committed Oct 27, 2019
1 parent b1f7d72 commit fef93a5
Show file tree
Hide file tree
Showing 5 changed files with 413 additions and 413 deletions.
78 changes: 39 additions & 39 deletions src/test/app-datepicker-dialog/custom-events.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,16 @@ describe(getTestName(name), () => {
`Calendar label ${testName} not ${
testName === '1' ? 'matched' : 'updated'} (${calendarLabel})`);
};
const goNextMonth = async (testName: string, times: number) => {
const btnNextMonthSelectorEl = t.getBtnNextMonthSelector();
isNotNull(btnNextMonthSelectorEl, `Next month button ${testName} not found`);

for (let i = 0; i < times; i += 1) {
triggerEvent(btnNextMonthSelectorEl, 'click');
await t.waitForDragAnimationFinished();
}
await forceUpdate(el);
};
// const goNextMonth = async (testName: string, times: number) => {
// const btnNextMonthSelectorEl = t.getBtnNextMonthSelector();
// isNotNull(btnNextMonthSelectorEl, `Next month button ${testName} not found`);

// for (let i = 0; i < times; i += 1) {
// triggerEvent(btnNextMonthSelectorEl, 'click');
// await t.waitForDragAnimationFinished();
// }
// await forceUpdate(el);
// };
const testBtnCalendarSelector = (testName: string, e: string) => {
const btnCalendarSelectorEl = t.getBtnCalendarSelector();
isNotNull(btnCalendarSelectorEl, `Calendar selector button ${testName} not found`);
Expand All @@ -166,35 +166,35 @@ describe(getTestName(name), () => {
document.body.removeChild(el);
});

it(`dispatches 'datepicker-animation-finished'`, async () => {
el.value = date13;
await forceUpdate(el);

el.open();
await forceUpdate(el);

t = queryInit(el);

const eventName = 'datepicker-animation-finished';
const didTestPass = new Promise((yay, nah) => {
let timer = -1;
try {
el.addEventListener('datepicker-animation-finished', () => {
clearTimeout(timer);
yay(true);
});
timer = runCustomEventDispatcherTimer(eventName);
} catch (e) {
nah(e);
}
});

testCalendarLabel('1', ['Jan 2020', 'January, 2020', 'January 2020']);
await goNextMonth('1', 2);

isTrue(await didTestPass, `'${eventName}' does not dispatch`);
testCalendarLabel('1', ['Mar 2020', 'March, 2020', 'March 2020']);
});
// it(`dispatches 'datepicker-animation-finished'`, async () => {
// el.value = date13;
// await forceUpdate(el);

// el.open();
// await forceUpdate(el);

// t = queryInit(el);

// const eventName = 'datepicker-animation-finished';
// const didTestPass = new Promise((yay, nah) => {
// let timer = -1;
// try {
// el.addEventListener('datepicker-animation-finished', () => {
// clearTimeout(timer);
// yay(true);
// });
// timer = runCustomEventDispatcherTimer(eventName);
// } catch (e) {
// nah(e);
// }
// });

// testCalendarLabel('1', ['Jan 2020', 'January, 2020', 'January 2020']);
// await goNextMonth('1', 2);

// isTrue(await didTestPass, `'${eventName}' does not dispatch`);
// testCalendarLabel('1', ['Mar 2020', 'March, 2020', 'March 2020']);
// });

it(`dispatches 'datepicker-keyboard-selected'`, async () => {
el.min = '2020-01-01';
Expand Down
Loading

0 comments on commit fef93a5

Please sign in to comment.