Skip to content

v2.0.0 #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 23 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@coreui/vue",
"description": "CoreUI Vue Bootstrap 4 layout components",
"version": "2.0.0-rc.3",
"version": "2.0.0",
"license": "MIT",
"main": "dist/coreui-vue.common.js",
"module": "dist/coreui-vue.esm.js",
@@ -63,29 +63,30 @@
"vue-perfect-scrollbar": "^0.1.0"
},
"devDependencies": {
"@vue/test-utils": "^1.0.0-beta.24",
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.6",
"babel-jest": "^22.4.4",
"babel-plugin-dynamic-import-node": "^1.2.0",
"babel-eslint": "^9.0.0",
"babel-jest": "^23.4.2",
"babel-plugin-dynamic-import-node": "^2.1.0",
"babel-plugin-module-resolver": "^3.1.1",
"babel-preset-vue-app": "^2.0.0",
"eslint": "^4.19.1",
"eslint-config-prettier": "^2.9.0",
"eslint": "^5.4.0",
"eslint-config-prettier": "^3.0.1",
"eslint-import-resolver-babel-module": "^4.0.0",
"eslint-plugin-html": "^4.0.3",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-jest": "^21.18.0",
"eslint-plugin-html": "^4.0.5",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jest": "^21.22.0",
"eslint-plugin-prettier": "^2.6.2",
"eslint-plugin-vue": "^4.7.0",
"eslint-plugin-vue": "^5.0.0-beta.3",
"husky": "^0.14.3",
"jest": "^22.4.4",
"jest": "^23.5.0",
"jest-serializer-html": "^5.0.0",
"jest-serializer-vue": "^1.0.0",
"jest-serializer-vue": "^2.0.2",
"jest-vue-preprocessor": "^1.4.0",
"lint-staged": "^7.1.3",
"lint-staged": "^7.2.2",
"lodash": "^4.17.10",
"node-sass": "^4.9.2",
"prettier": "^1.13.7",
"node-sass": "^4.9.3",
"prettier": "^1.14.2",
"rollup": "^0.59.4",
"rollup-plugin-babel": "^3.0.7",
"rollup-plugin-commonjs": "^9.1.3",
@@ -95,15 +96,15 @@
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-uglify": "^3.0.0",
"rollup-plugin-vue": "^4.3.1",
"sass-loader": "^7.0.3",
"rollup-plugin-vue": "^4.3.2",
"sass-loader": "^7.1.0",
"uglify-es": "^3.3.9",
"vue": "^2.5.16",
"vue": "^2.5.17",
"vue-jest": "^2.6.0",
"vue-loader": "^15.2.6",
"vue-server-renderer": "^2.5.16",
"vue-template-compiler": "^2.5.16",
"vue-test-utils": "^1.0.0-beta.11"
"vue-loader": "^15.4.1",
"vue-router": "^3.0.1",
"vue-server-renderer": "^2.5.17",
"vue-template-compiler": "^2.5.17"
},
"lint-staged": {
"*.{js,vue}": [
19 changes: 19 additions & 0 deletions src/components/__tests__/Aside.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { mount } from '@vue/test-utils'
import Aside from "../Aside/Aside";

describe("Aside.vue", () => {
// Inspect the raw component options
it('has isFixed method', () => {
expect(typeof Aside.methods.isFixed).toBe('function')
})
it('has isOffCanvas method', () => {
expect(typeof Aside.methods.isOffCanvas).toBe('function')
})
it('renders correctly', () => {
const wrapper = mount(Aside)
expect(wrapper.element).toMatchSnapshot()
expect(wrapper.is('aside')).toBe(true)
expect(wrapper.classes()).toContain('aside-menu')
expect(wrapper.element.textContent).toEqual('Aside')
})
});
18 changes: 18 additions & 0 deletions src/components/__tests__/AsideToggler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { mount } from "@vue/test-utils";
import AsideToggler from "../Aside/AsideToggler";

describe("AsideToggler.vue", () => {
// Inspect the raw component options
it('has toggle method', () => {
expect(typeof AsideToggler.methods.toggle).toBe('function')
})
it('has asideToggle method', () => {
expect(typeof AsideToggler.methods.asideToggle).toBe('function')
})
it('renders correctly', () => {
const wrapper = mount(AsideToggler)
expect(wrapper.element).toMatchSnapshot()
expect(wrapper.is('button')).toBe(true)
expect(wrapper.classes()).toContain('navbar-toggler')
})
});
26 changes: 26 additions & 0 deletions src/components/__tests__/Callout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { mount } from "@vue/test-utils";
import Callout from "../Callout/Callout";

describe("Callout.vue", () => {
// Inspect the raw component options
it("should have default props", () => {
const wrapper = mount(Callout, {
propsData: {
variant: ''
}
})
expect(wrapper.props().variant).toBe('')
});
it('has classList computed property', () => {
expect(typeof Callout.computed.classList).toBe('function')
})
it('has calloutVariant computed property', () => {
expect(typeof Callout.computed.calloutVariant).toBe('function')
})
it('renders correctly', () => {
const wrapper = mount(Callout)
expect(wrapper.element).toMatchSnapshot()
expect(wrapper.element.textContent).toEqual('Callout')
expect(wrapper.classes()).toContain('callout')
})
});
15 changes: 15 additions & 0 deletions src/components/__tests__/Footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { mount } from "@vue/test-utils";
import Footer from "../Footer/Footer";

describe("Footer.vue", () => {
// Inspect the raw component options
it('has isFixed method', () => {
expect(typeof Footer.methods.isFixed).toBe('function')
})
it('renders correctly', () => {
const wrapper = mount(Footer)
expect(wrapper.element).toMatchSnapshot()
expect(wrapper.element.textContent).toEqual('Footer')
expect(wrapper.classes()).toContain('app-footer')
})
});
16 changes: 16 additions & 0 deletions src/components/__tests__/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { mount } from "@vue/test-utils";
import Header from "../Header/Header";

describe("Header.vue", () => {
// Inspect the raw component options
it('has isFixed method', () => {
expect(typeof Header.methods.isFixed).toBe('function')
})
it('renders correctly', () => {
const wrapper = mount(Header)
expect(wrapper.element).toMatchSnapshot()
expect(wrapper.element.textContent).toEqual('Header')
expect(wrapper.classes()).toContain('app-header')
expect(wrapper.classes()).toContain('navbar')
})
});
22 changes: 22 additions & 0 deletions src/components/__tests__/HeaderDropdown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { shallowMount } from '@vue/test-utils'
import HeaderDropdown from '../Header/HeaderDropdown';

describe("HeaderDropdown.vue", () => {
// Inspect the raw component options
it("should have default props", () => {
const wrapper = shallowMount(HeaderDropdown, {
propsData: {
right: false,
noCaret: false
}
})
expect(wrapper.props().right).toBe(false)
expect(wrapper.props().noCaret).toBe(false)
});
it('renders correctly', () => {
const wrapper = shallowMount(HeaderDropdown)
expect(wrapper.element).toMatchSnapshot()
expect(wrapper.find('span').text()).toBe('dropdown')
expect(wrapper.find('span').classes()).toContain('text-center')
})
});
23 changes: 23 additions & 0 deletions src/components/__tests__/Sidebar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { mount } from '@vue/test-utils'
import Sidebar from "../Sidebar/Sidebar";

describe("Sidebar.vue", () => {
// Inspect the raw component options
it("should have default props", () => {
const wrapper = mount(Sidebar, {
propsData: {
fixed: false,
}
})
expect(wrapper.props().fixed).toBe(false)
});
it('has isFixed method', () => {
expect(typeof Sidebar.methods.isFixed).toBe('function')
})
it('renders correctly', () => {
const wrapper = mount(Sidebar)
expect(wrapper.element).toMatchSnapshot()
expect(wrapper.text()).toBe('Sidebar')
expect(wrapper.classes()).toContain('sidebar')
})
});
14 changes: 14 additions & 0 deletions src/components/__tests__/SidebarFooter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { mount } from '@vue/test-utils'
import SidebarFooter from "../Sidebar/SidebarFooter";

describe("SidebarFooter.vue", () => {
// Inspect the raw component options
it('has hasSlotDefault computed property', () => {
expect(typeof SidebarFooter.computed.hasSlotDefault).toBe('function')
})
it('renders correctly', () => {
const wrapper = mount(SidebarFooter, { slots: { default: 'test'}})
expect(wrapper.element).toMatchSnapshot()
expect(wrapper.classes()).toContain('sidebar-footer')
})
});
14 changes: 14 additions & 0 deletions src/components/__tests__/SidebarForm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { mount } from '@vue/test-utils'
import SidebarForm from "../Sidebar/SidebarForm";

describe("SidebarForm.vue", () => {
// Inspect the raw component options
it('has hasSlotDefault computed property', () => {
expect(typeof SidebarForm.computed.hasSlotDefault).toBe('function')
})
it('renders correctly', () => {
const wrapper = mount(SidebarForm, { slots: { default: 'test'}})
expect(wrapper.element).toMatchSnapshot()
expect(wrapper.classes()).toContain('sidebar-form')
})
});
14 changes: 14 additions & 0 deletions src/components/__tests__/SidebarHeader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { mount } from '@vue/test-utils'
import SidebarHeader from "../Sidebar/SidebarHeader";

describe("SidebarHeader.vue", () => {
// Inspect the raw component options
it('has hasSlotDefault computed property', () => {
expect(typeof SidebarHeader.computed.hasSlotDefault).toBe('function')
})
it('renders correctly', () => {
const wrapper = mount(SidebarHeader, { slots: { default: 'test'}})
expect(wrapper.element).toMatchSnapshot()
expect(wrapper.classes()).toContain('sidebar-header')
})
});
20 changes: 20 additions & 0 deletions src/components/__tests__/SidebarMinimizer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { mount } from "@vue/test-utils";
import SidebarMinimizer from "../Sidebar/SidebarMinimizer";

describe("SidebarMinimizer.vue", () => {
// Inspect the raw component options
it('has onClick method', () => {
expect(typeof SidebarMinimizer.methods.onClick).toBe('function')
})
it('has sidebarMinimize method', () => {
expect(typeof SidebarMinimizer.methods.sidebarMinimize).toBe('function')
})
it('has brandMinimize method', () => {
expect(typeof SidebarMinimizer.methods.brandMinimize).toBe('function')
})
it('renders correctly', () => {
const wrapper = mount(SidebarMinimizer)
expect(wrapper.element).toMatchSnapshot()
expect(wrapper.classes()).toContain('sidebar-minimizer')
})
});
15 changes: 15 additions & 0 deletions src/components/__tests__/SidebarNavDivider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { mount } from '@vue/test-utils'
import SidebarNavDivider from "../Sidebar/SidebarNavDivider";

describe("SidebarNavDivider.vue", () => {
// Inspect the raw component options
it('has hasSlotDefault computed property', () => {
expect(typeof SidebarNavDivider.computed.classList).toBe('function')
expect(typeof SidebarNavDivider.computed.itemClasses).toBe('function')
})
it('renders correctly', () => {
const wrapper = mount(SidebarNavDivider)
expect(wrapper.element).toMatchSnapshot()
expect(wrapper.classes()).toContain('divider')
})
});
36 changes: 36 additions & 0 deletions src/components/__tests__/SidebarNavDropdown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { shallowMount, createLocalVue } from '@vue/test-utils'
import VueRouter from 'vue-router'
import SidebarNavDropdown from "../Sidebar/SidebarNavDropdown";

const localVue = createLocalVue()
localVue.use(VueRouter)
const router = new VueRouter()

describe("SidebarNavDropdown.vue", () => {
// Inspect the raw component options
it("should have default props", () => {
const wrapper = shallowMount(SidebarNavDropdown, {
localVue,
router,
propsData: {
name: 'test',
url: '',
icon: ''
}
})
expect(wrapper.props().name).toEqual('test')
expect(wrapper.props().url).toBe('')
expect(wrapper.props().icon).toBe('')
});
it('has classIcon computed property', () => {
expect(typeof SidebarNavDropdown.computed.classIcon).toBe('function')
})
it('has handleClick method', () => {
expect(typeof SidebarNavDropdown.methods.handleClick).toBe('function')
})
it('renders correctly', () => {
const wrapper = shallowMount(SidebarNavDropdown, { localVue, router })
expect(wrapper.element).toMatchSnapshot()
expect(wrapper.is('router-link-stub')).toBe(true)
})
});
15 changes: 15 additions & 0 deletions src/components/__tests__/SidebarNavItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { mount } from '@vue/test-utils'
import SidebarNavItem from "../Sidebar/SidebarNavItem";

describe("SidebarNavItem.vue", () => {
// Inspect the raw component options
it('has computed properties', () => {
expect(typeof SidebarNavItem.computed.classList).toBe('function')
expect(typeof SidebarNavItem.computed.itemClasses).toBe('function')
})
it('renders correctly', () => {
const wrapper = mount(SidebarNavItem, { slots: { default: 'test'}})
expect(wrapper.element).toMatchSnapshot()
expect(wrapper.classes()).toContain('nav-item')
})
});
36 changes: 36 additions & 0 deletions src/components/__tests__/SidebarNavLabel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { mount } from '@vue/test-utils'
import SidebarNavLabel from "../Sidebar/SidebarNavLabel";

describe("SidebarNavLabel.vue", () => {
// Inspect the raw component options
test("should have default props", () => {
const wrapper = mount(SidebarNavLabel, {
propsData: {
name: 'test',
url: '',
icon: 'fa fa-circle',
classes: '',
label: { variant: 'info' }
}
})
expect(wrapper.props().name).toEqual('test')
expect(wrapper.props().url).toBe('')
expect(wrapper.props().icon).toBe('fa fa-circle')
});
it('has hasSlotDefault computed property', () => {
expect(typeof SidebarNavLabel.computed.classList).toBe('function')
})
it('has getClasses method', () => {
expect(typeof SidebarNavLabel.methods.getClasses).toBe('function')
})
it('renders correctly', () => {
const wrapper = mount(SidebarNavLabel, {
propsData: {
label: { variant: 'info' },
icon: 'fa fa-circle'
}
})
expect(wrapper.element).toMatchSnapshot()
expect(wrapper.classes()).toContain('hidden-cn')
})
});
Loading