From 166dd00dfb91b63d170b764c307d1ff68af32dee Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 20 Apr 2020 19:54:12 +0800 Subject: [PATCH] test(Tab): add dynamic insert case (#6102) --- .../test/__snapshots__/insert.spec.js.snap | 23 ++++++++++++++++ src/tab/test/insert.spec.js | 27 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 src/tab/test/__snapshots__/insert.spec.js.snap create mode 100644 src/tab/test/insert.spec.js diff --git a/src/tab/test/__snapshots__/insert.spec.js.snap b/src/tab/test/__snapshots__/insert.spec.js.snap new file mode 100644 index 000000000..8718f18e6 --- /dev/null +++ b/src/tab/test/__snapshots__/insert.spec.js.snap @@ -0,0 +1,23 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`insert tab dynamically 1`] = ` +
+
+
+ + + +
+
+
+
+ +
+
2
+
+ +
+
+`; diff --git a/src/tab/test/insert.spec.js b/src/tab/test/insert.spec.js new file mode 100644 index 000000000..ba7f9f478 --- /dev/null +++ b/src/tab/test/insert.spec.js @@ -0,0 +1,27 @@ +import { mount, later } from '../../../test'; + +// this case will throw wierd error in index.spec.js +// so separate it +test('insert tab dynamically', async () => { + const wrapper = mount({ + template: ` + + 1 +
+ 2 +
+ 3 +
+ `, + data() { + return { + insert: false, + active: 1, + }; + }, + }); + + await later(); + wrapper.setData({ insert: true }); + expect(wrapper).toMatchSnapshot(); +});