Skip to content

Commit 3f5fa9c

Browse files
authored
Merge pull request #15 from coreui/dev-vnext
v2.0.0
2 parents d6432da + 659eb63 commit 3f5fa9c

39 files changed

+701
-36
lines changed

package.json

+23-22
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@coreui/vue",
33
"description": "CoreUI Vue Bootstrap 4 layout components",
4-
"version": "2.0.0-rc.3",
4+
"version": "2.0.0",
55
"license": "MIT",
66
"main": "dist/coreui-vue.common.js",
77
"module": "dist/coreui-vue.esm.js",
@@ -63,29 +63,30 @@
6363
"vue-perfect-scrollbar": "^0.1.0"
6464
},
6565
"devDependencies": {
66+
"@vue/test-utils": "^1.0.0-beta.24",
6667
"babel-core": "^6.26.3",
67-
"babel-eslint": "^8.2.6",
68-
"babel-jest": "^22.4.4",
69-
"babel-plugin-dynamic-import-node": "^1.2.0",
68+
"babel-eslint": "^9.0.0",
69+
"babel-jest": "^23.4.2",
70+
"babel-plugin-dynamic-import-node": "^2.1.0",
7071
"babel-plugin-module-resolver": "^3.1.1",
7172
"babel-preset-vue-app": "^2.0.0",
72-
"eslint": "^4.19.1",
73-
"eslint-config-prettier": "^2.9.0",
73+
"eslint": "^5.4.0",
74+
"eslint-config-prettier": "^3.0.1",
7475
"eslint-import-resolver-babel-module": "^4.0.0",
75-
"eslint-plugin-html": "^4.0.3",
76-
"eslint-plugin-import": "^2.12.0",
77-
"eslint-plugin-jest": "^21.18.0",
76+
"eslint-plugin-html": "^4.0.5",
77+
"eslint-plugin-import": "^2.14.0",
78+
"eslint-plugin-jest": "^21.22.0",
7879
"eslint-plugin-prettier": "^2.6.2",
79-
"eslint-plugin-vue": "^4.7.0",
80+
"eslint-plugin-vue": "^5.0.0-beta.3",
8081
"husky": "^0.14.3",
81-
"jest": "^22.4.4",
82+
"jest": "^23.5.0",
8283
"jest-serializer-html": "^5.0.0",
83-
"jest-serializer-vue": "^1.0.0",
84+
"jest-serializer-vue": "^2.0.2",
8485
"jest-vue-preprocessor": "^1.4.0",
85-
"lint-staged": "^7.1.3",
86+
"lint-staged": "^7.2.2",
8687
"lodash": "^4.17.10",
87-
"node-sass": "^4.9.2",
88-
"prettier": "^1.13.7",
88+
"node-sass": "^4.9.3",
89+
"prettier": "^1.14.2",
8990
"rollup": "^0.59.4",
9091
"rollup-plugin-babel": "^3.0.7",
9192
"rollup-plugin-commonjs": "^9.1.3",
@@ -95,15 +96,15 @@
9596
"rollup-plugin-node-resolve": "^3.3.0",
9697
"rollup-plugin-replace": "^2.0.0",
9798
"rollup-plugin-uglify": "^3.0.0",
98-
"rollup-plugin-vue": "^4.3.1",
99-
"sass-loader": "^7.0.3",
99+
"rollup-plugin-vue": "^4.3.2",
100+
"sass-loader": "^7.1.0",
100101
"uglify-es": "^3.3.9",
101-
"vue": "^2.5.16",
102+
"vue": "^2.5.17",
102103
"vue-jest": "^2.6.0",
103-
"vue-loader": "^15.2.6",
104-
"vue-server-renderer": "^2.5.16",
105-
"vue-template-compiler": "^2.5.16",
106-
"vue-test-utils": "^1.0.0-beta.11"
104+
"vue-loader": "^15.4.1",
105+
"vue-router": "^3.0.1",
106+
"vue-server-renderer": "^2.5.17",
107+
"vue-template-compiler": "^2.5.17"
107108
},
108109
"lint-staged": {
109110
"*.{js,vue}": [

src/components/__tests__/Aside.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { mount } from '@vue/test-utils'
2+
import Aside from "../Aside/Aside";
3+
4+
describe("Aside.vue", () => {
5+
// Inspect the raw component options
6+
it('has isFixed method', () => {
7+
expect(typeof Aside.methods.isFixed).toBe('function')
8+
})
9+
it('has isOffCanvas method', () => {
10+
expect(typeof Aside.methods.isOffCanvas).toBe('function')
11+
})
12+
it('renders correctly', () => {
13+
const wrapper = mount(Aside)
14+
expect(wrapper.element).toMatchSnapshot()
15+
expect(wrapper.is('aside')).toBe(true)
16+
expect(wrapper.classes()).toContain('aside-menu')
17+
expect(wrapper.element.textContent).toEqual('Aside')
18+
})
19+
});
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { mount } from "@vue/test-utils";
2+
import AsideToggler from "../Aside/AsideToggler";
3+
4+
describe("AsideToggler.vue", () => {
5+
// Inspect the raw component options
6+
it('has toggle method', () => {
7+
expect(typeof AsideToggler.methods.toggle).toBe('function')
8+
})
9+
it('has asideToggle method', () => {
10+
expect(typeof AsideToggler.methods.asideToggle).toBe('function')
11+
})
12+
it('renders correctly', () => {
13+
const wrapper = mount(AsideToggler)
14+
expect(wrapper.element).toMatchSnapshot()
15+
expect(wrapper.is('button')).toBe(true)
16+
expect(wrapper.classes()).toContain('navbar-toggler')
17+
})
18+
});

src/components/__tests__/Callout.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { mount } from "@vue/test-utils";
2+
import Callout from "../Callout/Callout";
3+
4+
describe("Callout.vue", () => {
5+
// Inspect the raw component options
6+
it("should have default props", () => {
7+
const wrapper = mount(Callout, {
8+
propsData: {
9+
variant: ''
10+
}
11+
})
12+
expect(wrapper.props().variant).toBe('')
13+
});
14+
it('has classList computed property', () => {
15+
expect(typeof Callout.computed.classList).toBe('function')
16+
})
17+
it('has calloutVariant computed property', () => {
18+
expect(typeof Callout.computed.calloutVariant).toBe('function')
19+
})
20+
it('renders correctly', () => {
21+
const wrapper = mount(Callout)
22+
expect(wrapper.element).toMatchSnapshot()
23+
expect(wrapper.element.textContent).toEqual('Callout')
24+
expect(wrapper.classes()).toContain('callout')
25+
})
26+
});

src/components/__tests__/Footer.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { mount } from "@vue/test-utils";
2+
import Footer from "../Footer/Footer";
3+
4+
describe("Footer.vue", () => {
5+
// Inspect the raw component options
6+
it('has isFixed method', () => {
7+
expect(typeof Footer.methods.isFixed).toBe('function')
8+
})
9+
it('renders correctly', () => {
10+
const wrapper = mount(Footer)
11+
expect(wrapper.element).toMatchSnapshot()
12+
expect(wrapper.element.textContent).toEqual('Footer')
13+
expect(wrapper.classes()).toContain('app-footer')
14+
})
15+
});

src/components/__tests__/Header.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { mount } from "@vue/test-utils";
2+
import Header from "../Header/Header";
3+
4+
describe("Header.vue", () => {
5+
// Inspect the raw component options
6+
it('has isFixed method', () => {
7+
expect(typeof Header.methods.isFixed).toBe('function')
8+
})
9+
it('renders correctly', () => {
10+
const wrapper = mount(Header)
11+
expect(wrapper.element).toMatchSnapshot()
12+
expect(wrapper.element.textContent).toEqual('Header')
13+
expect(wrapper.classes()).toContain('app-header')
14+
expect(wrapper.classes()).toContain('navbar')
15+
})
16+
});
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { shallowMount } from '@vue/test-utils'
2+
import HeaderDropdown from '../Header/HeaderDropdown';
3+
4+
describe("HeaderDropdown.vue", () => {
5+
// Inspect the raw component options
6+
it("should have default props", () => {
7+
const wrapper = shallowMount(HeaderDropdown, {
8+
propsData: {
9+
right: false,
10+
noCaret: false
11+
}
12+
})
13+
expect(wrapper.props().right).toBe(false)
14+
expect(wrapper.props().noCaret).toBe(false)
15+
});
16+
it('renders correctly', () => {
17+
const wrapper = shallowMount(HeaderDropdown)
18+
expect(wrapper.element).toMatchSnapshot()
19+
expect(wrapper.find('span').text()).toBe('dropdown')
20+
expect(wrapper.find('span').classes()).toContain('text-center')
21+
})
22+
});

src/components/__tests__/Sidebar.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { mount } from '@vue/test-utils'
2+
import Sidebar from "../Sidebar/Sidebar";
3+
4+
describe("Sidebar.vue", () => {
5+
// Inspect the raw component options
6+
it("should have default props", () => {
7+
const wrapper = mount(Sidebar, {
8+
propsData: {
9+
fixed: false,
10+
}
11+
})
12+
expect(wrapper.props().fixed).toBe(false)
13+
});
14+
it('has isFixed method', () => {
15+
expect(typeof Sidebar.methods.isFixed).toBe('function')
16+
})
17+
it('renders correctly', () => {
18+
const wrapper = mount(Sidebar)
19+
expect(wrapper.element).toMatchSnapshot()
20+
expect(wrapper.text()).toBe('Sidebar')
21+
expect(wrapper.classes()).toContain('sidebar')
22+
})
23+
});
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { mount } from '@vue/test-utils'
2+
import SidebarFooter from "../Sidebar/SidebarFooter";
3+
4+
describe("SidebarFooter.vue", () => {
5+
// Inspect the raw component options
6+
it('has hasSlotDefault computed property', () => {
7+
expect(typeof SidebarFooter.computed.hasSlotDefault).toBe('function')
8+
})
9+
it('renders correctly', () => {
10+
const wrapper = mount(SidebarFooter, { slots: { default: 'test'}})
11+
expect(wrapper.element).toMatchSnapshot()
12+
expect(wrapper.classes()).toContain('sidebar-footer')
13+
})
14+
});
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { mount } from '@vue/test-utils'
2+
import SidebarForm from "../Sidebar/SidebarForm";
3+
4+
describe("SidebarForm.vue", () => {
5+
// Inspect the raw component options
6+
it('has hasSlotDefault computed property', () => {
7+
expect(typeof SidebarForm.computed.hasSlotDefault).toBe('function')
8+
})
9+
it('renders correctly', () => {
10+
const wrapper = mount(SidebarForm, { slots: { default: 'test'}})
11+
expect(wrapper.element).toMatchSnapshot()
12+
expect(wrapper.classes()).toContain('sidebar-form')
13+
})
14+
});
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { mount } from '@vue/test-utils'
2+
import SidebarHeader from "../Sidebar/SidebarHeader";
3+
4+
describe("SidebarHeader.vue", () => {
5+
// Inspect the raw component options
6+
it('has hasSlotDefault computed property', () => {
7+
expect(typeof SidebarHeader.computed.hasSlotDefault).toBe('function')
8+
})
9+
it('renders correctly', () => {
10+
const wrapper = mount(SidebarHeader, { slots: { default: 'test'}})
11+
expect(wrapper.element).toMatchSnapshot()
12+
expect(wrapper.classes()).toContain('sidebar-header')
13+
})
14+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { mount } from "@vue/test-utils";
2+
import SidebarMinimizer from "../Sidebar/SidebarMinimizer";
3+
4+
describe("SidebarMinimizer.vue", () => {
5+
// Inspect the raw component options
6+
it('has onClick method', () => {
7+
expect(typeof SidebarMinimizer.methods.onClick).toBe('function')
8+
})
9+
it('has sidebarMinimize method', () => {
10+
expect(typeof SidebarMinimizer.methods.sidebarMinimize).toBe('function')
11+
})
12+
it('has brandMinimize method', () => {
13+
expect(typeof SidebarMinimizer.methods.brandMinimize).toBe('function')
14+
})
15+
it('renders correctly', () => {
16+
const wrapper = mount(SidebarMinimizer)
17+
expect(wrapper.element).toMatchSnapshot()
18+
expect(wrapper.classes()).toContain('sidebar-minimizer')
19+
})
20+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { mount } from '@vue/test-utils'
2+
import SidebarNavDivider from "../Sidebar/SidebarNavDivider";
3+
4+
describe("SidebarNavDivider.vue", () => {
5+
// Inspect the raw component options
6+
it('has hasSlotDefault computed property', () => {
7+
expect(typeof SidebarNavDivider.computed.classList).toBe('function')
8+
expect(typeof SidebarNavDivider.computed.itemClasses).toBe('function')
9+
})
10+
it('renders correctly', () => {
11+
const wrapper = mount(SidebarNavDivider)
12+
expect(wrapper.element).toMatchSnapshot()
13+
expect(wrapper.classes()).toContain('divider')
14+
})
15+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { shallowMount, createLocalVue } from '@vue/test-utils'
2+
import VueRouter from 'vue-router'
3+
import SidebarNavDropdown from "../Sidebar/SidebarNavDropdown";
4+
5+
const localVue = createLocalVue()
6+
localVue.use(VueRouter)
7+
const router = new VueRouter()
8+
9+
describe("SidebarNavDropdown.vue", () => {
10+
// Inspect the raw component options
11+
it("should have default props", () => {
12+
const wrapper = shallowMount(SidebarNavDropdown, {
13+
localVue,
14+
router,
15+
propsData: {
16+
name: 'test',
17+
url: '',
18+
icon: ''
19+
}
20+
})
21+
expect(wrapper.props().name).toEqual('test')
22+
expect(wrapper.props().url).toBe('')
23+
expect(wrapper.props().icon).toBe('')
24+
});
25+
it('has classIcon computed property', () => {
26+
expect(typeof SidebarNavDropdown.computed.classIcon).toBe('function')
27+
})
28+
it('has handleClick method', () => {
29+
expect(typeof SidebarNavDropdown.methods.handleClick).toBe('function')
30+
})
31+
it('renders correctly', () => {
32+
const wrapper = shallowMount(SidebarNavDropdown, { localVue, router })
33+
expect(wrapper.element).toMatchSnapshot()
34+
expect(wrapper.is('router-link-stub')).toBe(true)
35+
})
36+
});
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { mount } from '@vue/test-utils'
2+
import SidebarNavItem from "../Sidebar/SidebarNavItem";
3+
4+
describe("SidebarNavItem.vue", () => {
5+
// Inspect the raw component options
6+
it('has computed properties', () => {
7+
expect(typeof SidebarNavItem.computed.classList).toBe('function')
8+
expect(typeof SidebarNavItem.computed.itemClasses).toBe('function')
9+
})
10+
it('renders correctly', () => {
11+
const wrapper = mount(SidebarNavItem, { slots: { default: 'test'}})
12+
expect(wrapper.element).toMatchSnapshot()
13+
expect(wrapper.classes()).toContain('nav-item')
14+
})
15+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { mount } from '@vue/test-utils'
2+
import SidebarNavLabel from "../Sidebar/SidebarNavLabel";
3+
4+
describe("SidebarNavLabel.vue", () => {
5+
// Inspect the raw component options
6+
test("should have default props", () => {
7+
const wrapper = mount(SidebarNavLabel, {
8+
propsData: {
9+
name: 'test',
10+
url: '',
11+
icon: 'fa fa-circle',
12+
classes: '',
13+
label: { variant: 'info' }
14+
}
15+
})
16+
expect(wrapper.props().name).toEqual('test')
17+
expect(wrapper.props().url).toBe('')
18+
expect(wrapper.props().icon).toBe('fa fa-circle')
19+
});
20+
it('has hasSlotDefault computed property', () => {
21+
expect(typeof SidebarNavLabel.computed.classList).toBe('function')
22+
})
23+
it('has getClasses method', () => {
24+
expect(typeof SidebarNavLabel.methods.getClasses).toBe('function')
25+
})
26+
it('renders correctly', () => {
27+
const wrapper = mount(SidebarNavLabel, {
28+
propsData: {
29+
label: { variant: 'info' },
30+
icon: 'fa fa-circle'
31+
}
32+
})
33+
expect(wrapper.element).toMatchSnapshot()
34+
expect(wrapper.classes()).toContain('hidden-cn')
35+
})
36+
});

0 commit comments

Comments
 (0)