File tree 23 files changed +46
-37
lines changed
23 files changed +46
-37
lines changed Original file line number Diff line number Diff line change 63
63
"vue-perfect-scrollbar" : " ^0.1.0"
64
64
},
65
65
"devDependencies" : {
66
+ "@vue/test-utils" : " ^1.0.0-beta.24" ,
66
67
"babel-core" : " ^6.26.3" ,
67
68
"babel-eslint" : " ^9.0.0" ,
68
69
"babel-jest" : " ^23.4.2" ,
103
104
"vue-loader" : " ^15.4.1" ,
104
105
"vue-router" : " ^3.0.1" ,
105
106
"vue-server-renderer" : " ^2.5.17" ,
106
- "vue-template-compiler" : " ^2.5.17" ,
107
- "vue-test-utils" : " ^1.0.0-beta.11"
107
+ "vue-template-compiler" : " ^2.5.17"
108
108
},
109
109
"lint-staged" : {
110
110
"*.{js,vue}" : [
Original file line number Diff line number Diff line change 1
- import { mount } from 'vue- test-utils'
1
+ import { mount } from '@ vue/ test-utils'
2
2
import Aside from "../Aside/Aside" ;
3
3
4
4
describe ( "Aside.vue" , ( ) => {
Original file line number Diff line number Diff line change 1
- import { mount } from "vue- test-utils" ;
1
+ import { mount } from "@ vue/ test-utils" ;
2
2
import AsideToggler from "../Aside/AsideToggler" ;
3
3
4
4
describe ( "AsideToggler.vue" , ( ) => {
Original file line number Diff line number Diff line change 1
- import { mount } from "vue- test-utils" ;
1
+ import { mount } from "@ vue/ test-utils" ;
2
2
import Callout from "../Callout/Callout" ;
3
3
4
4
describe ( "Callout.vue" , ( ) => {
Original file line number Diff line number Diff line change 1
- import { mount } from "vue- test-utils" ;
1
+ import { mount } from "@ vue/ test-utils" ;
2
2
import Footer from "../Footer/Footer" ;
3
3
4
4
describe ( "Footer.vue" , ( ) => {
Original file line number Diff line number Diff line change 1
- import { mount } from "vue- test-utils" ;
1
+ import { mount } from "@ vue/ test-utils" ;
2
2
import Header from "../Header/Header" ;
3
3
4
4
describe ( "Header.vue" , ( ) => {
Original file line number Diff line number Diff line change 1
- import { mount } from 'vue- test-utils'
1
+ import { shallowMount } from '@ vue/ test-utils'
2
2
import HeaderDropdown from '../Header/HeaderDropdown' ;
3
3
4
4
describe ( "HeaderDropdown.vue" , ( ) => {
5
5
// Inspect the raw component options
6
6
it ( "should have default props" , ( ) => {
7
- const wrapper = mount ( HeaderDropdown , {
7
+ const wrapper = shallowMount ( HeaderDropdown , {
8
8
propsData : {
9
9
right : false ,
10
10
noCaret : false
@@ -14,7 +14,7 @@ describe("HeaderDropdown.vue", () => {
14
14
expect ( wrapper . props ( ) . noCaret ) . toBe ( false )
15
15
} ) ;
16
16
it ( 'renders correctly' , ( ) => {
17
- const wrapper = mount ( HeaderDropdown )
17
+ const wrapper = shallowMount ( HeaderDropdown )
18
18
expect ( wrapper . element ) . toMatchSnapshot ( )
19
19
expect ( wrapper . find ( 'span' ) . text ( ) ) . toBe ( 'dropdown' )
20
20
expect ( wrapper . find ( 'span' ) . classes ( ) ) . toContain ( 'text-center' )
Original file line number Diff line number Diff line change 1
- import { mount } from 'vue- test-utils'
1
+ import { mount } from '@ vue/ test-utils'
2
2
import Sidebar from "../Sidebar/Sidebar" ;
3
3
4
4
describe ( "Sidebar.vue" , ( ) => {
Original file line number Diff line number Diff line change 1
- import { mount } from 'vue- test-utils'
1
+ import { mount } from '@ vue/ test-utils'
2
2
import SidebarFooter from "../Sidebar/SidebarFooter" ;
3
3
4
4
describe ( "SidebarFooter.vue" , ( ) => {
Original file line number Diff line number Diff line change 1
- import { mount } from 'vue- test-utils'
1
+ import { mount } from '@ vue/ test-utils'
2
2
import SidebarForm from "../Sidebar/SidebarForm" ;
3
3
4
4
describe ( "SidebarForm.vue" , ( ) => {
Original file line number Diff line number Diff line change 1
- import { mount } from 'vue- test-utils'
1
+ import { mount } from '@ vue/ test-utils'
2
2
import SidebarHeader from "../Sidebar/SidebarHeader" ;
3
3
4
4
describe ( "SidebarHeader.vue" , ( ) => {
Original file line number Diff line number Diff line change 1
- import { mount } from "vue- test-utils" ;
1
+ import { mount } from "@ vue/ test-utils" ;
2
2
import SidebarMinimizer from "../Sidebar/SidebarMinimizer" ;
3
3
4
4
describe ( "SidebarMinimizer.vue" , ( ) => {
Original file line number Diff line number Diff line change 1
- import { mount } from 'vue- test-utils'
1
+ import { mount } from '@ vue/ test-utils'
2
2
import SidebarNavDivider from "../Sidebar/SidebarNavDivider" ;
3
3
4
4
describe ( "SidebarNavDivider.vue" , ( ) => {
Original file line number Diff line number Diff line change 1
- import { mount , createLocalVue } from 'vue- test-utils'
1
+ import { shallowMount , createLocalVue } from '@ vue/ test-utils'
2
2
import VueRouter from 'vue-router'
3
3
import SidebarNavDropdown from "../Sidebar/SidebarNavDropdown" ;
4
4
@@ -9,7 +9,9 @@ const router = new VueRouter()
9
9
describe ( "SidebarNavDropdown.vue" , ( ) => {
10
10
// Inspect the raw component options
11
11
it ( "should have default props" , ( ) => {
12
- const wrapper = mount ( SidebarNavDropdown , {
12
+ const wrapper = shallowMount ( SidebarNavDropdown , {
13
+ localVue,
14
+ router,
13
15
propsData : {
14
16
name : 'test' ,
15
17
url : '' ,
@@ -27,8 +29,8 @@ describe("SidebarNavDropdown.vue", () => {
27
29
expect ( typeof SidebarNavDropdown . methods . handleClick ) . toBe ( 'function' )
28
30
} )
29
31
it ( 'renders correctly' , ( ) => {
30
- const wrapper = mount ( SidebarNavDropdown , { localVue, router } )
32
+ const wrapper = shallowMount ( SidebarNavDropdown , { localVue, router } )
31
33
expect ( wrapper . element ) . toMatchSnapshot ( )
32
- expect ( wrapper . is ( 'li ' ) ) . toBe ( true )
34
+ expect ( wrapper . is ( 'router-link-stub ' ) ) . toBe ( true )
33
35
} )
34
36
} ) ;
Original file line number Diff line number Diff line change 1
- import { mount } from 'vue- test-utils'
1
+ import { mount } from '@ vue/ test-utils'
2
2
import SidebarNavItem from "../Sidebar/SidebarNavItem" ;
3
3
4
4
describe ( "SidebarNavItem.vue" , ( ) => {
Original file line number Diff line number Diff line change 1
- import { mount } from 'vue- test-utils'
1
+ import { mount } from '@ vue/ test-utils'
2
2
import SidebarNavLabel from "../Sidebar/SidebarNavLabel" ;
3
3
4
4
describe ( "SidebarNavLabel.vue" , ( ) => {
Original file line number Diff line number Diff line change 1
- import { mount , createLocalVue } from 'vue- test-utils'
1
+ import { shallowMount , createLocalVue } from '@ vue/ test-utils'
2
2
import VueRouter from 'vue-router'
3
3
import SidebarNavLink from "../Sidebar/SidebarNavLink" ;
4
4
@@ -9,7 +9,9 @@ const router = new VueRouter()
9
9
describe ( "SidebarNavLink.vue" , ( ) => {
10
10
// Inspect the raw component options
11
11
test ( "should have default props" , ( ) => {
12
- const wrapper = mount ( SidebarNavLink , {
12
+ const wrapper = shallowMount ( SidebarNavLink , {
13
+ localVue,
14
+ router,
13
15
propsData : {
14
16
name : 'test' ,
15
17
url : '' ,
@@ -31,7 +33,7 @@ describe("SidebarNavLink.vue", () => {
31
33
expect ( typeof SidebarNavLink . computed . isExternalLink ) . toBe ( 'function' )
32
34
} )
33
35
it ( 'renders correctly' , ( ) => {
34
- const wrapper = mount ( SidebarNavLink , { localVue, router } )
36
+ const wrapper = shallowMount ( SidebarNavLink , { localVue, router } )
35
37
expect ( wrapper . element ) . toMatchSnapshot ( )
36
38
expect ( wrapper . is ( 'div' ) ) . toBe ( true )
37
39
} )
Original file line number Diff line number Diff line change 1
- import { mount } from "vue- test-utils" ;
1
+ import { mount } from "@ vue/ test-utils" ;
2
2
import SidebarNavTitle from "../Sidebar/SidebarNavTitle" ;
3
3
4
4
describe ( "SidebarNavTitle.vue" , ( ) => {
Original file line number Diff line number Diff line change 1
- import { mount } from "vue- test-utils" ;
1
+ import { mount } from "@ vue/ test-utils" ;
2
2
import SidebarToggler from "../Sidebar/SidebarToggler" ;
3
3
4
4
describe ( "SidebarToggler.vue" , ( ) => {
Original file line number Diff line number Diff line change 1
- import { mount } from "vue- test-utils" ;
1
+ import { mount } from "@ vue/ test-utils" ;
2
2
import Switch from "../Switch/Switch" ;
3
3
4
4
describe ( "Switch.vue" , ( ) => {
Original file line number Diff line number Diff line change 1
1
// Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
3
3
exports [` SidebarNavDropdown.vue renders correctly 1` ] = `
4
- <li
5
- class = " nav-item nav-dropdown router-link-exact-active router-link-active"
6
- disabled = " disabled"
4
+ <router-link-stub
5
+ class = " nav-item nav-dropdown"
6
+ disabled = " "
7
+ event = " click"
8
+ tag = " li"
9
+ to = " "
7
10
>
8
11
<div
9
12
class = " nav-link nav-dropdown-toggle"
@@ -17,5 +20,5 @@ exports[`SidebarNavDropdown.vue renders correctly 1`] = `
17
20
<ul
18
21
class = " nav-dropdown-items"
19
22
/>
20
- </li >
23
+ </router-link-stub >
21
24
` ;
Original file line number Diff line number Diff line change 2
2
3
3
exports [` SidebarNavLink.vue renders correctly 1` ] = `
4
4
<div >
5
- <a
6
- class = " router-link-exact-active router-link-active nav-link"
7
- href = " #/"
5
+ <router-link-stub
6
+ class = " nav-link"
7
+ event = " click"
8
+ tag = " a"
9
+ to = " "
8
10
>
9
11
<i
10
12
class = " nav-icon"
11
13
/>
12
14
13
15
14
16
<!---->
15
- </a >
17
+ </router-link-stub >
16
18
</div >
17
19
` ;
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ exports[`Switch.vue renders correctly 1`] = `
7
7
<input
8
8
class = " switch-input form-check-input"
9
9
false-value = " uncheckedValue"
10
- id = " switch-id-1 "
10
+ id = " switch-id-3 "
11
11
true-value = " value"
12
12
type = " checkbox"
13
13
value = " true"
You can’t perform that action at this time.
0 commit comments