From 5960f11f6ce864a5ce492f49195d8504eb977933 Mon Sep 17 00:00:00 2001
From: woothu <32914662+woothu@users.noreply.github.com>
Date: Mon, 17 Feb 2020 17:18:37 +0100
Subject: [PATCH] test: fix snapshots and sidebar test
---
tests/unit/containers/TheSidebar.spec.js | 17 +-
.../__snapshots__/TheContainer.spec.js.snap | 6 +-
.../__snapshots__/TheHeader.spec.js.snap | 32 +-
.../TheHeaderDropdownAccnt.spec.js.snap | 64 +-
.../__snapshots__/TheSidebar.spec.js.snap | 6 +
.../__snapshots__/Dashboard.spec.js.snap | 28 +-
.../__snapshots__/Jumbotrons.spec.js.snap | 12 +-
.../__snapshots__/ListGroups.spec.js.snap | 224 +++---
.../base/__snapshots__/Navbars.spec.js.snap | 84 +--
.../base/__snapshots__/Navs.spec.js.snap | 158 ++--
.../__snapshots__/ProgressBars.spec.js.snap | 12 +-
.../base/__snapshots__/Switches.spec.js.snap | 8 +-
.../base/__snapshots__/Tabs.spec.js.snap | 93 ++-
.../base/__snapshots__/Tooltips.spec.js.snap | 56 +-
.../__snapshots__/ButtonGroups.spec.js.snap | 204 +++---
.../StandardButtons.spec.js.snap | 676 +++++++++---------
.../__snapshots__/Alerts.spec.js.snap | 16 +-
.../__snapshots__/Modals.spec.js.snap | 36 +-
.../pages/__snapshots__/Login.spec.js.snap | 12 +-
.../pages/__snapshots__/Register.spec.js.snap | 12 +-
.../users/__snapshots__/User.spec.js.snap | 4 +-
21 files changed, 932 insertions(+), 828 deletions(-)
diff --git a/tests/unit/containers/TheSidebar.spec.js b/tests/unit/containers/TheSidebar.spec.js
index a899d59f..a9bb1e09 100644
--- a/tests/unit/containers/TheSidebar.spec.js
+++ b/tests/unit/containers/TheSidebar.spec.js
@@ -1,16 +1,25 @@
-import Vue from 'vue'
-import { shallowMount } from '@vue/test-utils';
+import { shallowMount, createLocalVue } from '@vue/test-utils';
import CoreuiVue from '@coreui/vue'
+import Vuex from 'vuex'
import TheSidebar from '@/containers/TheSidebar'
-Vue.use(CoreuiVue)
+const localVue = createLocalVue()
+localVue.use(CoreuiVue)
+localVue.use(Vuex)
+
+const store = new Vuex.Store({
+ state: {
+ sidebarShow: 'responsive',
+ sidebarMinimize: false
+ }
+})
describe('TheSidebar.vue', () => {
it('has a name', () => {
expect(TheSidebar.name).toBe('TheSidebar')
})
test('renders correctly', () => {
- const wrapper = shallowMount(TheSidebar)
+ const wrapper = shallowMount(TheSidebar, { store, localVue })
expect(wrapper.element).toMatchSnapshot()
})
})
diff --git a/tests/unit/containers/__snapshots__/TheContainer.spec.js.snap b/tests/unit/containers/__snapshots__/TheContainer.spec.js.snap
index 0699f8e5..2d0fdb91 100644
--- a/tests/unit/containers/__snapshots__/TheContainer.spec.js.snap
+++ b/tests/unit/containers/__snapshots__/TheContainer.spec.js.snap
@@ -7,7 +7,7 @@ exports[`TheContainer.vue renders correctly 1`] = `
@@ -26,9 +26,9 @@ exports[`TheContainer.vue renders correctly 1`] = `
/>
+
+
-
-
`;
diff --git a/tests/unit/containers/__snapshots__/TheHeader.spec.js.snap b/tests/unit/containers/__snapshots__/TheHeader.spec.js.snap
index 90737c65..27b29b16 100644
--- a/tests/unit/containers/__snapshots__/TheHeader.spec.js.snap
+++ b/tests/unit/containers/__snapshots__/TheHeader.spec.js.snap
@@ -21,7 +21,13 @@ exports[`TheHeader.vue renders correctly 1`] = `
/>
@@ -93,9 +99,9 @@ exports[`TheHeader.vue renders correctly 1`] = `
class="d-md-down-none mx-2"
>
@@ -109,9 +115,9 @@ exports[`TheHeader.vue renders correctly 1`] = `
class="d-md-down-none mx-2"
>
@@ -125,9 +131,9 @@ exports[`TheHeader.vue renders correctly 1`] = `
class="d-md-down-none mx-2"
>
@@ -145,7 +151,7 @@ exports[`TheHeader.vue renders correctly 1`] = `
tag="div"
>
diff --git a/tests/unit/containers/__snapshots__/TheHeaderDropdownAccnt.spec.js.snap b/tests/unit/containers/__snapshots__/TheHeaderDropdownAccnt.spec.js.snap
index d8430350..ea5c17c3 100644
--- a/tests/unit/containers/__snapshots__/TheHeaderDropdownAccnt.spec.js.snap
+++ b/tests/unit/containers/__snapshots__/TheHeaderDropdownAccnt.spec.js.snap
@@ -23,9 +23,9 @@ exports[`TheHeaderDropdownAccnt.vue renders correctly 1`] = `
@@ -35,11 +35,11 @@ exports[`TheHeaderDropdownAccnt.vue renders correctly 1`] = `
Updates
@@ -61,11 +61,11 @@ exports[`TheHeaderDropdownAccnt.vue renders correctly 1`] = `
Messages
@@ -87,11 +87,11 @@ exports[`TheHeaderDropdownAccnt.vue renders correctly 1`] = `
Tasks
@@ -113,11 +113,11 @@ exports[`TheHeaderDropdownAccnt.vue renders correctly 1`] = `
Comments
@@ -151,9 +151,9 @@ exports[`TheHeaderDropdownAccnt.vue renders correctly 1`] = `
@@ -165,9 +165,9 @@ exports[`TheHeaderDropdownAccnt.vue renders correctly 1`] = `
@@ -177,11 +177,11 @@ exports[`TheHeaderDropdownAccnt.vue renders correctly 1`] = `
Payments
@@ -203,11 +203,11 @@ exports[`TheHeaderDropdownAccnt.vue renders correctly 1`] = `
Projects
@@ -235,9 +235,9 @@ exports[`TheHeaderDropdownAccnt.vue renders correctly 1`] = `
diff --git a/tests/unit/containers/__snapshots__/TheSidebar.spec.js.snap b/tests/unit/containers/__snapshots__/TheSidebar.spec.js.snap
index f91e398f..a98adb2a 100644
--- a/tests/unit/containers/__snapshots__/TheSidebar.spec.js.snap
+++ b/tests/unit/containers/__snapshots__/TheSidebar.spec.js.snap
@@ -10,7 +10,13 @@ exports[`TheSidebar.vue renders correctly 1`] = `
show="responsive"
>
@@ -136,9 +136,9 @@ exports[`Navbars.vue renders correctly 1`] = `
@@ -146,9 +146,9 @@ exports[`Navbars.vue renders correctly 1`] = `
@@ -156,9 +156,9 @@ exports[`Navbars.vue renders correctly 1`] = `
@@ -175,9 +175,9 @@ exports[`Navbars.vue renders correctly 1`] = `
togglertext="User"
>
@@ -185,9 +185,9 @@ exports[`Navbars.vue renders correctly 1`] = `
@@ -222,9 +222,9 @@ exports[`Navbars.vue renders correctly 1`] = `
tag="nav"
>
@@ -375,9 +375,9 @@ exports[`Navbars.vue renders correctly 1`] = `
@@ -385,9 +385,9 @@ exports[`Navbars.vue renders correctly 1`] = `
@@ -395,9 +395,9 @@ exports[`Navbars.vue renders correctly 1`] = `
@@ -414,9 +414,9 @@ exports[`Navbars.vue renders correctly 1`] = `
togglertext="User"
>
@@ -424,9 +424,9 @@ exports[`Navbars.vue renders correctly 1`] = `
@@ -472,11 +472,11 @@ exports[`Navbars.vue renders correctly 1`] = `
/>
@@ -43,18 +43,18 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -62,10 +62,10 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -91,12 +91,14 @@ exports[`Navs.vue renders correctly 1`] = `
-
+
@@ -106,38 +108,40 @@ exports[`Navs.vue renders correctly 1`] = `
-
- Link
-
+
-
- Another Link
-
+
- Disabled
+
@@ -164,9 +168,9 @@ exports[`Navs.vue renders correctly 1`] = `
>
@@ -176,9 +180,9 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -188,9 +192,9 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -200,10 +204,10 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -234,9 +238,9 @@ exports[`Navs.vue renders correctly 1`] = `
>
@@ -244,9 +248,9 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -254,9 +258,9 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -264,10 +268,10 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -299,9 +303,9 @@ exports[`Navs.vue renders correctly 1`] = `
>
@@ -309,9 +313,9 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -319,9 +323,9 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -329,10 +333,10 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -364,9 +368,9 @@ exports[`Navs.vue renders correctly 1`] = `
>
@@ -374,9 +378,9 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -384,9 +388,9 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -394,10 +398,10 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -424,13 +428,12 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -438,9 +441,9 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -451,16 +454,15 @@ exports[`Navs.vue renders correctly 1`] = `
button-content="Dropdown"
caret="true"
flip="true"
- id="nav7_ddown"
- nav=""
+ innav="true"
offset="0,0"
placement="bottom-end"
togglertext="Dropdown"
>
@@ -468,9 +470,9 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -482,9 +484,9 @@ exports[`Navs.vue renders correctly 1`] = `
/>
@@ -526,9 +528,9 @@ exports[`Navs.vue renders correctly 1`] = `
>
@@ -536,9 +538,9 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -546,9 +548,9 @@ exports[`Navs.vue renders correctly 1`] = `
@@ -556,10 +558,10 @@ exports[`Navs.vue renders correctly 1`] = `
diff --git a/tests/unit/views/base/__snapshots__/ProgressBars.spec.js.snap b/tests/unit/views/base/__snapshots__/ProgressBars.spec.js.snap
index 7a7f6386..2c8ab1ad 100644
--- a/tests/unit/views/base/__snapshots__/ProgressBars.spec.js.snap
+++ b/tests/unit/views/base/__snapshots__/ProgressBars.spec.js.snap
@@ -69,11 +69,11 @@ exports[`ProgressBars.vue renders correctly 1`] = `
@@ -53,6 +58,11 @@ exports[`Tabs.vue renders correctly 1`] = `
@@ -65,7 +75,12 @@ exports[`Tabs.vue renders correctly 1`] = `
@@ -100,6 +115,11 @@ exports[`Tabs.vue renders correctly 1`] = `
>
@@ -112,6 +132,11 @@ exports[`Tabs.vue renders correctly 1`] = `
@@ -124,7 +149,12 @@ exports[`Tabs.vue renders correctly 1`] = `
@@ -159,6 +189,11 @@ exports[`Tabs.vue renders correctly 1`] = `
>
-
+
-
+
-
+
-
+
-
+
-
+
@@ -398,9 +398,9 @@ exports[`ButtonGroups.vue renders correctly 1`] = `
@@ -412,9 +412,9 @@ exports[`ButtonGroups.vue renders correctly 1`] = `
/>
@@ -423,11 +423,11 @@ exports[`ButtonGroups.vue renders correctly 1`] = `
@@ -457,9 +457,9 @@ exports[`ButtonGroups.vue renders correctly 1`] = `
@@ -471,9 +471,9 @@ exports[`ButtonGroups.vue renders correctly 1`] = `
/>
@@ -509,10 +509,10 @@ exports[`ButtonGroups.vue renders correctly 1`] = `
vertical="true"
>
@@ -824,9 +824,9 @@ exports[`ButtonGroups.vue renders correctly 1`] = `
@@ -834,9 +834,9 @@ exports[`ButtonGroups.vue renders correctly 1`] = `
@@ -848,10 +848,10 @@ exports[`ButtonGroups.vue renders correctly 1`] = `
class="mx-1"
>