test: update tests

This commit is contained in:
woothu
2020-07-16 12:31:55 +02:00
parent 7ee3b0f4db
commit a4a0b68f19
41 changed files with 77 additions and 81 deletions
+2 -2
View File
@@ -20,11 +20,11 @@ describe('Dashboard.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Dashboard)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Dashboard', () => {
const wrapper = shallowMount(Dashboard)
expect(wrapper.is(Dashboard)).toBe(true)
expect(wrapper.findComponent(Dashboard)).toBeTruthy()
})
it('should render correct content', () => {
const wrapper = shallowMount(Dashboard)
+2 -2
View File
@@ -19,11 +19,11 @@ describe('Breadcrumbs.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Breadcrumbs)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Breadcrumbs', () => {
const wrapper = shallowMount(Breadcrumbs)
expect(wrapper.is(Breadcrumbs)).toBe(true)
expect(wrapper.findComponent(Breadcrumbs)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = mount(Breadcrumbs)
+2 -2
View File
@@ -19,11 +19,11 @@ describe('Cards.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Cards)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Cards', () => {
const wrapper = shallowMount(Cards)
expect(wrapper.is(Cards)).toBe(true)
expect(wrapper.findComponent(Cards)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = mount(Cards)
+1 -1
View File
@@ -11,7 +11,7 @@ describe('Carousels.vue', () => {
})
it('is Carousels', () => {
const wrapper = shallowMount(Carousels)
expect(wrapper.is(Carousels)).toBe(true)
expect(wrapper.findComponent(Carousels)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = mount(Carousels)
+1 -1
View File
@@ -11,7 +11,7 @@ describe('Collapses.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Collapses)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = mount(Collapses)
+1 -1
View File
@@ -11,7 +11,7 @@ describe('Forms.vue', () => {
})
it('is Forms', () => {
const wrapper = shallowMount(Forms)
expect(wrapper.is(Forms)).toBe(true)
expect(wrapper.findComponent(Forms)).toBeTruthy()
})
// render random chackboxes
// test('renders correctly', () => {
+2 -2
View File
@@ -11,11 +11,11 @@ describe('Jumbotrons.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Jumbotrons)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Jumbotrons', () => {
const wrapper = shallowMount(Jumbotrons)
expect(wrapper.is(Jumbotrons)).toBe(true)
expect(wrapper.findComponent(Jumbotrons)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(Jumbotrons)
+2 -2
View File
@@ -11,11 +11,11 @@ describe('ListGroups.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(ListGroups)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is ListGroups', () => {
const wrapper = shallowMount(ListGroups)
expect(wrapper.is(ListGroups)).toBe(true)
expect(wrapper.findComponent(ListGroups)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(ListGroups)
+2 -2
View File
@@ -11,11 +11,11 @@ describe('Navbars.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Navbars)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Navbars', () => {
const wrapper = shallowMount(Navbars)
expect(wrapper.is(Navbars)).toBe(true)
expect(wrapper.findComponent(Navbars)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(Navbars)
+2 -2
View File
@@ -11,11 +11,11 @@ describe('Navs.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Navs)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Navbars', () => {
const wrapper = shallowMount(Navs)
expect(wrapper.is(Navs)).toBe(true)
expect(wrapper.findComponent(Navs)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(Navs)
+2 -2
View File
@@ -19,11 +19,11 @@ describe('Paginations.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Paginations)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Paginations', () => {
const wrapper = shallowMount(Paginations)
expect(wrapper.is(Paginations)).toBe(true)
expect(wrapper.findComponent(Paginations)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(Paginations)
+2 -2
View File
@@ -14,10 +14,10 @@ describe('Popovers.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Popovers)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Popovers', () => {
const wrapper = shallowMount(Popovers)
expect(wrapper.is(Popovers)).toBe(true)
expect(wrapper.findComponent(Popovers)).toBeTruthy()
})
})
+2 -2
View File
@@ -19,11 +19,11 @@ describe('ProgressBars.vue', () => {
})
it('is Vue instance', () => {
const wrapper = mount(ProgressBars)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is ProgressBars', () => {
const wrapper = mount(ProgressBars)
expect(wrapper.is(ProgressBars)).toBe(true)
expect(wrapper.findComponent(ProgressBars)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(ProgressBars)
+2 -2
View File
@@ -14,11 +14,11 @@ describe('Switches.vue', () => {
})
it('is Vue instance', () => {
const wrapper = mount(Switches)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Switches', () => {
const wrapper = mount(Switches)
expect(wrapper.is(Switches)).toBe(true)
expect(wrapper.findComponent(Switches)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(Switches)
+2 -2
View File
@@ -11,11 +11,11 @@ describe('Table.vue', () => {
})
it('is Vue instance', () => {
const wrapper = mount(Table)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Table', () => {
const wrapper = mount(Table)
expect(wrapper.is(Table)).toBe(true)
expect(wrapper.findComponent(Table)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(Table)
+2 -2
View File
@@ -11,11 +11,11 @@ describe('Tables.vue', () => {
})
it('is Vue instance', () => {
const wrapper = mount(Tables)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Tables', () => {
const wrapper = mount(Tables)
expect(wrapper.is(Tables)).toBe(true)
expect(wrapper.findComponent(Tables)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(Tables)
+2 -2
View File
@@ -17,11 +17,11 @@ describe('Tabs.vue', () => {
})
it('is Vue instance', () => {
const wrapper = mount(Tabs)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Tabs', () => {
const wrapper = mount(Tabs)
expect(wrapper.is(Tabs)).toBe(true)
expect(wrapper.findComponent(Tabs)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(Tabs)
+2 -2
View File
@@ -14,11 +14,11 @@ describe('Tooltips.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Tooltips)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Tooltips', () => {
const wrapper = shallowMount(Tooltips)
expect(wrapper.is(Tooltips)).toBe(true)
expect(wrapper.findComponent(Tooltips)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(Tooltips)
@@ -11,11 +11,11 @@ describe('BrandButtons.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(BrandButtons)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is BrandButtons', () => {
const wrapper = shallowMount(BrandButtons)
expect(wrapper.is(BrandButtons)).toBe(true)
expect(wrapper.findComponent(BrandButtons)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = mount(BrandButtons)
@@ -11,11 +11,11 @@ describe('Dropdowns.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Dropdowns)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Dropdowns', () => {
const wrapper = shallowMount(Dropdowns)
expect(wrapper.is(Dropdowns)).toBe(true)
expect(wrapper.findComponent(Dropdowns)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = mount(Dropdowns)
@@ -11,10 +11,10 @@ describe('ButtonGroups.vue', () => {
expect(ButtonGroups.name).toBe('ButtonGroups')
})
it('is Vue instance', () => {
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is ButtonGroups', () => {
expect(wrapper.is(ButtonGroups)).toBe(true)
expect(wrapper.findComponent(ButtonGroups)).toBeTruthy()
})
test('renders correctly', () => {
expect(wrapper.element).toMatchSnapshot()
@@ -19,11 +19,11 @@ describe('StandardButtons.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(StandardButtons)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is StandardButtons', () => {
const wrapper = shallowMount(StandardButtons)
expect(wrapper.is(StandardButtons)).toBe(true)
expect(wrapper.findComponent(StandardButtons)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(StandardButtons)
@@ -11,11 +11,11 @@ describe('CChartBarExample', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(CChartBarExample)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is CChartBarExample', () => {
const wrapper = shallowMount(CChartBarExample)
expect(wrapper.is(CChartBarExample)).toBe(true)
expect(wrapper.findComponent(CChartBarExample)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(CChartBarExample)
+2 -2
View File
@@ -11,11 +11,11 @@ describe('Charts.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Charts)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Charts', () => {
const wrapper = shallowMount(Charts)
expect(wrapper.is(Charts)).toBe(true)
expect(wrapper.findComponent(Charts)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(Charts)
+2 -2
View File
@@ -11,10 +11,10 @@ describe('Brands.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Brands)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Brands', () => {
const wrapper = shallowMount(Brands)
expect(wrapper.is(Brands)).toBe(true)
expect(wrapper.findComponent(Brands)).toBeTruthy()
})
})
+2 -2
View File
@@ -11,10 +11,10 @@ describe('CoreUIIcons.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(CoreUIIcons)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is CoreUIIcons', () => {
const wrapper = shallowMount(CoreUIIcons)
expect(wrapper.is(CoreUIIcons)).toBe(true)
expect(wrapper.findComponent(CoreUIIcons)).toBeTruthy()
})
})
+2 -2
View File
@@ -11,10 +11,10 @@ describe('Flags.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Flags)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Flags', () => {
const wrapper = shallowMount(Flags)
expect(wrapper.is(Flags)).toBe(true)
expect(wrapper.findComponent(Flags)).toBeTruthy()
})
})
@@ -17,11 +17,11 @@ describe('Alerts.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Alerts)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Alerts', () => {
const wrapper = shallowMount(Alerts)
expect(wrapper.is(Alerts)).toBe(true)
expect(wrapper.findComponent(Alerts)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(Alerts)
@@ -1,5 +1,5 @@
import Vue from 'vue'
import { shallowMount, mount } from '@vue/test-utils'
import { mount } from '@vue/test-utils'
import CoreuiVue from '@coreui/vue'
import Badges from '@/views/notifications/Badges'
@@ -9,10 +9,6 @@ describe('Badges.vue', () => {
it('has a name', () => {
expect(Badges.name).toBe('Badges')
})
it('is Badges', () => {
const wrapper = shallowMount(Badges)
expect(wrapper.is(Badges)).toBe(true)
})
test('renders correctly', () => {
const wrapper = mount(Badges)
expect(wrapper.element).toMatchSnapshot()
@@ -19,11 +19,11 @@ describe('Modals.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Modals)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Modals', () => {
const wrapper = shallowMount(Modals)
expect(wrapper.is(Modals)).toBe(true)
expect(wrapper.findComponent(Modals)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(Modals)
+2 -2
View File
@@ -11,11 +11,11 @@ describe('Login.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Login)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Login', () => {
const wrapper = shallowMount(Login)
expect(wrapper.is(Login)).toBe(true)
expect(wrapper.findComponent(Login)).toBeTruthy()
})
it('should render correct content', () => {
const wrapper = shallowMount(Login)
+2 -2
View File
@@ -11,11 +11,11 @@ describe('Page404.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Page404)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Page500', () => {
const wrapper = shallowMount(Page404)
expect(wrapper.is(Page404)).toBe(true)
expect(wrapper.findComponent(Page404)).toBeTruthy()
})
it('should render correct content', () => {
const wrapper = shallowMount(Page404)
+2 -2
View File
@@ -11,11 +11,11 @@ describe('Page500.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Page500)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Page500', () => {
const wrapper = shallowMount(Page500)
expect(wrapper.is(Page500)).toBe(true)
expect(wrapper.findComponent(Page500)).toBeTruthy()
})
it('should render correct content', () => {
const wrapper = shallowMount(Page500)
+2 -2
View File
@@ -11,11 +11,11 @@ describe('Register.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Register)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Register', () => {
const wrapper = shallowMount(Register)
expect(wrapper.is(Register)).toBe(true)
expect(wrapper.findComponent(Register)).toBeTruthy()
})
it('should render correct content', () => {
const wrapper = shallowMount(Register)
+2 -2
View File
@@ -11,11 +11,11 @@ describe('Colors.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Colors)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Colors', () => {
const wrapper = shallowMount(Colors)
expect(wrapper.is(Colors)).toBe(true)
expect(wrapper.findComponent(Colors)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = mount(Colors)
+2 -2
View File
@@ -11,11 +11,11 @@ describe('Typography.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Typography)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Typography', () => {
const wrapper = shallowMount(Typography)
expect(wrapper.is(Typography)).toBe(true)
expect(wrapper.findComponent(Typography)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(Typography)
+2 -2
View File
@@ -23,10 +23,10 @@ describe('User.vue', () => {
expect(User.name).toBe('User')
})
it('is Vue instance', () => {
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is User', () => {
expect(wrapper.is(User)).toBe(true)
expect(wrapper.findComponent(User)).toBeTruthy()
})
it('should have methods', () => {
expect(typeof User.methods.goBack).toEqual('function')
+2 -2
View File
@@ -21,14 +21,14 @@ describe('Users.vue', () => {
localVue,
router
})
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Users', () => {
const wrapper = shallowMount(Users,{
localVue,
router
})
expect(wrapper.is(Users)).toBe(true)
expect(wrapper.findComponent(Users)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(Users, {
+2 -2
View File
@@ -11,11 +11,11 @@ describe('Widgets.vue', () => {
})
it('is Vue instance', () => {
const wrapper = shallowMount(Widgets)
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.vm).toBeTruthy()
})
it('is Widgets', () => {
const wrapper = shallowMount(Widgets)
expect(wrapper.is(Widgets)).toBe(true)
expect(wrapper.findComponent(Widgets)).toBeTruthy()
})
test('renders correctly', () => {
const wrapper = shallowMount(Widgets)