Skip to content

Commit ea01f93

Browse files
committed
tests: add some issing tests
1 parent 87e783e commit ea01f93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1141
-17
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
## [vue](./README.md) version `changelog`
22

3+
##### `v2.0.0-rc.0`
4+
- test(unit): add some views testing
5+
- test(e2e): add testing for mobile `sidebar-show`
6+
- chore: update `vue` to `2.5.17`
7+
- chore: update `vue-template-compiler` to `2.5.17`
8+
- chore: update `@vue/cli-plugin-babel` to `3.0.1`
9+
- chore: update `@vue/cli-plugin-e2e-nightwatch` to `3.0.1`
10+
- chore: update `@vue/cli-plugin-eslint` to `3.0.1`
11+
- chore: update `@vue/cli-plugin-unit-jest` to `3.0.1`
12+
- chore: update `@vue/cli-service` to `3.0.1`
13+
- chore: update `@vue/test-utils` to `1.0.0-beta.24`
14+
- chore: update `babel-jest` to `23.4.2`
15+
- chore: update `node-sass` to `4.9.3`
16+
- chore: update `sass-loader` to `7.1.0`
17+
- chore: update `vue-chartjs` to `3.4.0`
18+
319
##### `v2.0.0-beta.13`
420
- fix(jest.config.js): solves - _SecurityError: localStorage is not available for opaque origins_
521
- chore: update `bootstrap` to `4.1.3`

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,28 @@
2222
"bootstrap-vue": "^2.0.0-rc.11",
2323
"chart.js": "^2.7.2",
2424
"core-js": "^2.5.7",
25-
"css-vars-ponyfill": "^1.8.0",
25+
"css-vars-ponyfill": "^1.9.0",
2626
"flag-icon-css": "^3.0.0",
2727
"font-awesome": "^4.7.0",
2828
"perfect-scrollbar": "^1.4.0",
2929
"simple-line-icons": "^2.4.1",
30-
"vue": "^2.5.16",
31-
"vue-chartjs": "^3.3.2",
30+
"vue": "^2.5.17",
31+
"vue-chartjs": "^3.4.0",
3232
"vue-perfect-scrollbar": "^0.1.0",
3333
"vue-router": "^3.0.1"
3434
},
3535
"devDependencies": {
36-
"@vue/cli-plugin-babel": "^3.0.0-rc.7",
37-
"@vue/cli-plugin-e2e-nightwatch": "^3.0.0-rc.7",
38-
"@vue/cli-plugin-eslint": "^3.0.0-rc.7",
39-
"@vue/cli-plugin-unit-jest": "^3.0.0-rc.7",
40-
"@vue/cli-service": "^3.0.0-rc.7",
41-
"@vue/test-utils": "^1.0.0-beta.21",
36+
"@vue/cli-plugin-babel": "^3.0.1",
37+
"@vue/cli-plugin-e2e-nightwatch": "^3.0.1",
38+
"@vue/cli-plugin-eslint": "^3.0.1",
39+
"@vue/cli-plugin-unit-jest": "^3.0.1",
40+
"@vue/cli-service": "^3.0.1",
41+
"@vue/test-utils": "^1.0.0-beta.24",
4242
"babel-core": "^7.0.0-bridge.0",
43-
"babel-jest": "^23.4.0",
44-
"node-sass": "^4.9.2",
45-
"sass-loader": "^7.0.3",
46-
"vue-template-compiler": "^2.5.16"
43+
"babel-jest": "^23.4.2",
44+
"node-sass": "^4.9.3",
45+
"sass-loader": "^7.1.0",
46+
"vue-template-compiler": "^2.5.17"
4747
},
4848
"browserslist": [
4949
"> 1%",

tests/e2e/specs/test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,24 @@ module.exports = {
8080
this.assert.cssClassNotPresent('/html/body', 'brand-minimized')
8181
})
8282

83+
browser
84+
.resizeWindow(800, 600)
85+
.pause(500)
86+
87+
browser
88+
.pause(500)
89+
.click('/html/body/div/header/button[1]', function (response) {
90+
console.log('response', typeof response)
91+
this.assert.cssClassPresent('/html/body', 'sidebar-show')
92+
})
93+
94+
browser
95+
.pause(500)
96+
.click('/html/body/div/div/div/nav/section/ul/li[1]/div/a', function (response) {
97+
console.log('response', typeof response)
98+
this.assert.cssClassNotPresent('/html/body', 'sidebar-show')
99+
})
100+
83101
browser
84102
.pause(5000)
85103
.end()

tests/unit/Alerts.spec.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import Vue from 'vue'
2+
import { shallowMount, mount } from '@vue/test-utils'
3+
import BootstrapVue from 'bootstrap-vue'
4+
import Alerts from '@/views/notifications/Alerts'
5+
6+
Vue.use(BootstrapVue)
7+
8+
describe('Alerts.vue', () => {
9+
it('has a name', () => {
10+
expect(Alerts.name).toMatch('alerts')
11+
})
12+
it('has a created hook', () => {
13+
expect(typeof Alerts.data).toMatch('function')
14+
})
15+
it('sets the correct default data', () => {
16+
expect(typeof Alerts.data).toMatch('function')
17+
const defaultData = Alerts.data()
18+
expect(defaultData.showDismissibleAlert).toBe(false)
19+
})
20+
it('is Vue instance', () => {
21+
const wrapper = shallowMount(Alerts)
22+
expect(wrapper.isVueInstance()).toBe(true)
23+
})
24+
it('is Alerts', () => {
25+
const wrapper = shallowMount(Alerts)
26+
expect(wrapper.is(Alerts)).toBe(true)
27+
})
28+
it('should render correct content', () => {
29+
const wrapper = mount(Alerts)
30+
expect(wrapper.find('header.card-header > div').text()).toMatch('Bootstrap Alert docs')
31+
})
32+
})

tests/unit/App.spec.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Vue from 'vue'
2+
import { shallowMount, mount } from '@vue/test-utils'
3+
import BootstrapVue from 'bootstrap-vue'
4+
import App from '@/App'
5+
6+
Vue.use(BootstrapVue)
7+
8+
describe('App.vue', () => {
9+
it('has a name', () => {
10+
expect(App.name).toMatch('app')
11+
})
12+
})

tests/unit/Badges.spec.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import Vue from 'vue'
2+
import { shallowMount, mount } from '@vue/test-utils'
3+
import BootstrapVue from 'bootstrap-vue'
4+
import Badges from '@/views/notifications/Badges'
5+
6+
Vue.use(BootstrapVue)
7+
8+
describe('Badges.vue', () => {
9+
it('has a name', () => {
10+
expect(Badges.name).toMatch('badges')
11+
})
12+
it('is Vue instance', () => {
13+
const wrapper = shallowMount(Badges)
14+
expect(wrapper.isVueInstance()).toBe(true)
15+
})
16+
it('is Badges', () => {
17+
const wrapper = shallowMount(Badges)
18+
expect(wrapper.is(Badges)).toBe(true)
19+
})
20+
it('should render correct content', () => {
21+
const wrapper = mount(Badges)
22+
expect(wrapper.find('header.card-header > div').text()).toMatch('Bootstrap Badge docs')
23+
})
24+
})

tests/unit/BrandButtons.spec.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import Vue from 'vue'
2+
import { shallowMount, mount } from '@vue/test-utils'
3+
import BootstrapVue from 'bootstrap-vue'
4+
import BrandButtons from '@/views/buttons/BrandButtons'
5+
6+
Vue.use(BootstrapVue)
7+
8+
describe('BrandButtons.vue', () => {
9+
it('has a name', () => {
10+
expect(BrandButtons.name).toMatch('brand-buttons')
11+
})
12+
it('is Vue instance', () => {
13+
const wrapper = shallowMount(BrandButtons)
14+
expect(wrapper.isVueInstance()).toBe(true)
15+
})
16+
it('is BrandButtons', () => {
17+
const wrapper = shallowMount(BrandButtons)
18+
expect(wrapper.is(BrandButtons)).toBe(true)
19+
})
20+
it('should render correct content', () => {
21+
const wrapper = mount(BrandButtons)
22+
expect(wrapper.find('div.card-header > div > strong').text()).toMatch('Brand Button')
23+
})
24+
})

tests/unit/Breadcrumbs.spec.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import Vue from 'vue'
2+
import { shallowMount, mount } from '@vue/test-utils'
3+
import BootstrapVue from 'bootstrap-vue'
4+
import Breadcrumbs from '@/views/base/Breadcrumbs'
5+
6+
Vue.use(BootstrapVue)
7+
8+
describe('Breadcrumbs.vue', () => {
9+
it('has a name', () => {
10+
expect(Breadcrumbs.name).toMatch('breadcrumbs')
11+
})
12+
it('has a created hook', () => {
13+
expect(typeof Breadcrumbs.data).toMatch('function')
14+
})
15+
it('sets the correct default data', () => {
16+
expect(typeof Breadcrumbs.data).toMatch('function')
17+
const defaultData = Breadcrumbs.data()
18+
expect(typeof defaultData.items).toMatch('object')
19+
})
20+
it('is Vue instance', () => {
21+
const wrapper = shallowMount(Breadcrumbs)
22+
expect(wrapper.isVueInstance()).toBe(true)
23+
})
24+
it('is Breadcrumbs', () => {
25+
const wrapper = shallowMount(Breadcrumbs)
26+
expect(wrapper.is(Breadcrumbs)).toBe(true)
27+
})
28+
it('should render correct content', () => {
29+
const wrapper = mount(Breadcrumbs)
30+
expect(wrapper.find('header.card-header > div > strong').text()).toMatch('Bootstrap Breadcrumb')
31+
})
32+
})

tests/unit/ButtonDropdowns.spec.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import Vue from 'vue'
2+
import { shallowMount, mount } from '@vue/test-utils'
3+
import BootstrapVue from 'bootstrap-vue'
4+
import Dropdowns from '@/views/buttons/Dropdowns'
5+
6+
Vue.use(BootstrapVue)
7+
8+
describe('Dropdowns.vue', () => {
9+
it('has a name', () => {
10+
expect(Dropdowns.name).toMatch('dropdowns')
11+
})
12+
it('is Vue instance', () => {
13+
const wrapper = shallowMount(Dropdowns)
14+
expect(wrapper.isVueInstance()).toBe(true)
15+
})
16+
it('is Dropdowns', () => {
17+
const wrapper = shallowMount(Dropdowns)
18+
expect(wrapper.is(Dropdowns)).toBe(true)
19+
})
20+
it('should render correct content', () => {
21+
const wrapper = mount(Dropdowns)
22+
expect(wrapper.find('header.card-header > div > strong').text()).toMatch('Bootstrap Dropdown')
23+
})
24+
})

tests/unit/ButtonGroups.spec.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import Vue from 'vue'
2+
import { shallowMount, mount } from '@vue/test-utils'
3+
import BootstrapVue from 'bootstrap-vue'
4+
import ButtonGroups from '@/views/buttons/ButtonGroups'
5+
6+
Vue.use(BootstrapVue)
7+
8+
describe('ButtonGroups.vue', () => {
9+
it('has a name', () => {
10+
expect(ButtonGroups.name).toMatch('button-groups')
11+
})
12+
it('is Vue instance', () => {
13+
const wrapper = shallowMount(ButtonGroups)
14+
expect(wrapper.isVueInstance()).toBe(true)
15+
})
16+
it('is ButtonGroups', () => {
17+
const wrapper = shallowMount(ButtonGroups)
18+
expect(wrapper.is(ButtonGroups)).toBe(true)
19+
})
20+
it('should render correct content', () => {
21+
const wrapper = mount(ButtonGroups)
22+
expect(wrapper.find('header.card-header').text()).toMatch('Bootstrap button group')
23+
})
24+
})

tests/unit/Cards.spec.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import Vue from 'vue'
2+
import { shallowMount, mount } from '@vue/test-utils'
3+
import BootstrapVue from 'bootstrap-vue'
4+
import Cards from '@/views/base/Cards'
5+
6+
Vue.use(BootstrapVue)
7+
8+
describe('Cards.vue', () => {
9+
it('has a name', () => {
10+
expect(Cards.name).toMatch('cards')
11+
})
12+
it('has a created hook', () => {
13+
expect(typeof Cards.data).toMatch('function')
14+
})
15+
it('sets the correct default data', () => {
16+
expect(typeof Cards.data).toMatch('function')
17+
const defaultData = Cards.data()
18+
expect(defaultData.show).toBe(true)
19+
})
20+
it('is Vue instance', () => {
21+
const wrapper = shallowMount(Cards)
22+
expect(wrapper.isVueInstance()).toBe(true)
23+
})
24+
it('is Cards', () => {
25+
const wrapper = shallowMount(Cards)
26+
expect(wrapper.is(Cards)).toBe(true)
27+
})
28+
it('should render correct content', () => {
29+
const wrapper = mount(Cards)
30+
expect(wrapper.find('div.card-header > div').text()).toMatch('Card title')
31+
})
32+
})

tests/unit/Carousels.spec.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import Vue from 'vue'
2+
import { shallowMount, mount } from '@vue/test-utils'
3+
import BootstrapVue from 'bootstrap-vue'
4+
import Carousels from '@/views/base/Carousels'
5+
6+
Vue.use(BootstrapVue)
7+
8+
describe('Carousels.vue', () => {
9+
it('has a name', () => {
10+
expect(Carousels.name).toMatch('carousels')
11+
})
12+
it('has a created hook', () => {
13+
expect(typeof Carousels.data).toMatch('function')
14+
})
15+
it('sets the correct default data', () => {
16+
expect(typeof Carousels.data).toMatch('function')
17+
const defaultData = Carousels.data()
18+
expect(defaultData.slide).toBe(0)
19+
})
20+
it('is Vue instance', () => {
21+
const wrapper = shallowMount(Carousels)
22+
expect(wrapper.isVueInstance()).toBe(true)
23+
})
24+
it('is Carousels', () => {
25+
const wrapper = shallowMount(Carousels)
26+
expect(wrapper.is(Carousels)).toBe(true)
27+
})
28+
it('should render correct content', () => {
29+
const wrapper = mount(Carousels)
30+
expect(wrapper.find('header.card-header > div > strong').text()).toMatch('Bootstrap Carousel')
31+
})
32+
})

tests/unit/Charts.spec.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import Vue from 'vue'
2+
import { shallowMount } from '@vue/test-utils'
3+
import BootstrapVue from 'bootstrap-vue'
4+
import Charts from '@/views/Charts'
5+
6+
Vue.use(BootstrapVue)
7+
8+
describe('Charts.vue', () => {
9+
it('has a name', () => {
10+
expect(Charts.name).toMatch('charts')
11+
})
12+
it('is Vue instance', () => {
13+
const wrapper = shallowMount(Charts)
14+
expect(wrapper.isVueInstance()).toBe(true)
15+
})
16+
it('is Charts', () => {
17+
const wrapper = shallowMount(Charts)
18+
expect(wrapper.is(Charts)).toBe(true)
19+
})
20+
})

tests/unit/Collapses.spec.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import Vue from 'vue'
2+
import { shallowMount, mount } from '@vue/test-utils'
3+
import BootstrapVue from 'bootstrap-vue'
4+
import Collapses from '@/views/base/Collapses'
5+
6+
Vue.use(BootstrapVue)
7+
8+
describe('Collapses.vue', () => {
9+
it('has a name', () => {
10+
expect(Collapses.name).toMatch('collapses')
11+
})
12+
it('has a created hook', () => {
13+
expect(typeof Collapses.data).toMatch('function')
14+
})
15+
it('sets the correct default data', () => {
16+
expect(typeof Collapses.data).toMatch('function')
17+
const defaultData = Collapses.data()
18+
expect(defaultData.showCollapse).toBe(true)
19+
})
20+
it('is Vue instance', () => {
21+
const wrapper = shallowMount(Collapses)
22+
expect(wrapper.isVueInstance()).toBe(true)
23+
})
24+
it('is Collapses', () => {
25+
const wrapper = shallowMount(Collapses)
26+
expect(wrapper.is(Collapses)).toBe(true)
27+
})
28+
it('should render correct content', () => {
29+
const wrapper = mount(Collapses)
30+
expect(wrapper.find('header.card-header > div > strong').text()).toMatch('Bootstrap Collapse')
31+
})
32+
})

0 commit comments

Comments
 (0)