From: Che Guevara <836934184@qq.com> Date: Tue, 28 Jul 2020 19:36:36 +0000 (+0800) Subject: test(transition): add invalid durations test case (#1702) X-Git-Tag: v3.0.0-rc.5~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06cad62ee869c37e8792647381e779d6b15a1368;p=thirdparty%2Fvuejs%2Fcore.git test(transition): add invalid durations test case (#1702) --- diff --git a/packages/vue/__tests__/Transition.spec.ts b/packages/vue/__tests__/Transition.spec.ts index 0c124d182c..70f038609b 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 + ) }) })