From 06cad62ee869c37e8792647381e779d6b15a1368 Mon Sep 17 00:00:00 2001 From: Che Guevara <836934184@qq.com> Date: Wed, 29 Jul 2020 03:36:36 +0800 Subject: [PATCH] test(transition): add invalid durations test case (#1702) --- packages/vue/__tests__/Transition.spec.ts | 38 +++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/packages/vue/__tests__/Transition.spec.ts b/packages/vue/__tests__/Transition.spec.ts index 0c124d18..70f03860 100644 --- a/packages/vue/__tests__/Transition.spec.ts +++ b/packages/vue/__tests__/Transition.spec.ts @@ -1799,7 +1799,41 @@ describe('e2e: Transition', () => { E2E_TIMEOUT ) - // fixme - test.todo('warn invalid durations') + test( + 'warn invalid durations', + async () => { + createApp({ + template: ` +
+ +
content
+
+
+ ` + }).mount(document.createElement('div')) + expect( + `[Vue warn]: explicit duration is NaN - ` + + 'the duration expression might be incorrect.' + ).toHaveBeenWarned() + + createApp({ + template: ` +
+ +
content
+
+
+ ` + }).mount(document.createElement('div')) + expect( + `[Vue warn]: explicit duration is not a valid number - ` + + `got ${JSON.stringify({})}` + ).toHaveBeenWarned() + }, + E2E_TIMEOUT + ) }) })