Skip to content

Commit eb0a1cd

Browse files
committed
test: update tests, small refactors
1 parent 2452c4b commit eb0a1cd

File tree

9 files changed

+21
-34
lines changed

9 files changed

+21
-34
lines changed

src/components/Button/tests/CButtonToolbar.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const ComponentName = 'CButtonToolbar'
55
const defaultWrapper = mount(Component)
66
const customWrapper = mount(Component, {
77
propsData: {
8-
justify: true
8+
justify: 'between'
99
},
1010
slots: {
1111
default: 'Custom button toolbar'

src/components/Button/tests/__snapshots__/CButtonToolbar.spec.js.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
exports[`CButtonToolbar renders correctly 1`] = `
44
<div
5+
aria-label="toolbar"
56
class="btn-toolbar"
67
role="toolbar"
78
/>
89
`;
910

1011
exports[`CButtonToolbar renders correctly 2`] = `
1112
<div
13+
aria-label="toolbar"
1214
class="btn-toolbar justify-content-between"
1315
role="toolbar"
1416
>

src/components/Card/tests/__snapshots__/CCard.spec.js.snap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ exports[`CCard renders correctly with slots 1`] = `
3030
<div
3131
class="card-body"
3232
>
33-
<!---->
34-
<!---->
3533
this should be rendered in body wrapper
3634
</div>
3735
<!---->

src/components/Card/tests/__snapshots__/CCardBody.spec.js.snap

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,5 @@
33
exports[`CCardBody renders correctly 1`] = `
44
<div
55
class="card-body bg-primary border-solid text-white text-left"
6-
>
7-
<h4
8-
class="card-title"
9-
>
10-
title
11-
</h4>
12-
<h6
13-
class="card-subtitle mb-2 text-muted"
14-
>
15-
subtitle
16-
</h6>
17-
<div>
18-
body content
19-
</div>
20-
</div>
6+
/>
217
`;

src/components/Form/CFormGroup.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<template functional>
2-
<div :class="[data.class, data.staticClass]"
3-
:style="[data.style, data.staticStyle]"
4-
role="group"
2+
<div
3+
:class="[data.class, data.staticClass]"
4+
:style="[data.style, data.staticStyle]"
5+
role="group"
56
>
67
<template v-if="props.wrapperClasses">
78
<slot name="label"></slot>

src/components/Sidebar/tests/CPerfectScrollbar.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Vue from 'vue'
88
const ComponentName = 'CPerfectScrollbar'
99
const wrapper = mount(Component, {
1010
propsData: {
11-
swicher: false
11+
switcher: false
1212
}
1313
})
1414

@@ -50,15 +50,15 @@ describe(`${ComponentName} .vue`, () => {
5050
expect(typeof errors).toBe('undefined')
5151
})
5252
it('do not initialize new instance when one is already set', () => {
53-
wrapper.setProps({ swicher: true })
53+
wrapper.setProps({ switcher: true })
5454
const spy = jest.spyOn(wrapper.vm, '__createPerfectScrollbar')
5555
wrapper.vm.__init()
5656
expect(spy).not.toBeCalled()
5757
})
5858
it('calls __uninit function on switch to false', () => {
5959
const spy = jest.spyOn(wrapper.vm, '__uninit')
6060
expect(spy).not.toBeCalled()
61-
wrapper.setProps({ swicher: false })
61+
wrapper.setProps({ switcher: false })
6262
expect(spy).toBeCalled()
6363
})
6464
it('calls __uninit function before destroy', () => {

src/components/Switch/tests/__snapshots__/CSwitch.spec.js.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22

33
exports[`CSwitch renders correctly 1`] = `
44
<label
5-
class="switch form-check-label switch-undefined"
5+
class="c-switch form-check-label c-switch-undefined"
66
>
77
<input
8-
class="switch-input form-check-input"
8+
class="c-switch-input form-check-input"
99
type="radio"
1010
value=""
1111
/>
1212
1313
<span
14-
class="switch-slider"
14+
class="c-switch-slider"
1515
/>
1616
</label>
1717
`;
1818

1919
exports[`CSwitch renders correctly 2`] = `
2020
<label
21-
class="switch form-check-label switch-outline-info-alt switch-lg switch-3d"
21+
class="c-switch form-check-label c-switch-outline-info-alt c-switch-lg c-switch-3d"
2222
>
2323
<input
24-
class="switch-input form-check-input"
24+
class="c-switch-input form-check-input"
2525
dataoff="dataOff"
2626
dataon="dataOn"
2727
id="myId"
@@ -32,7 +32,7 @@ exports[`CSwitch renders correctly 2`] = `
3232
/>
3333
3434
<span
35-
class="switch-slider"
35+
class="c-switch-slider"
3636
/>
3737
</label>
3838
`;

src/components/Widgets/tests/__snapshots__/CWidgetDropdown.spec.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`CWidgetDropdown matches custom props snapshot 1`] = `
44
<div
5-
class="card bg-info"
5+
class="card bg-info text-white"
66
>
77
88
<div
@@ -25,7 +25,7 @@ exports[`CWidgetDropdown matches custom props snapshot 1`] = `
2525

2626
exports[`CWidgetDropdown matches default props snapshot 1`] = `
2727
<div
28-
class="card bg-undefined"
28+
class="card bg-undefined text-white"
2929
>
3030
3131
<div

src/components/Widgets/tests/__snapshots__/CWidgetHeaderDetails.spec.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`CWidgetHeaderDetails matches custom props snapshot 1`] = `
44
<div
5-
class="card bg-info"
5+
class="card bg-info text-white"
66
>
77
<div
88
class="card-header"
@@ -43,7 +43,7 @@ exports[`CWidgetHeaderDetails matches custom props snapshot 1`] = `
4343

4444
exports[`CWidgetHeaderDetails matches default props snapshot 1`] = `
4545
<div
46-
class="card bg-undefined"
46+
class="card bg-undefined text-white"
4747
>
4848
<div
4949
class="card-header"

0 commit comments

Comments
 (0)