Skip to content

Commit 19d9bd7

Browse files
committed
test: update tests
1 parent 204cde0 commit 19d9bd7

File tree

10 files changed

+29
-29
lines changed

10 files changed

+29
-29
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`Loads and display CAccordionButton component renders correctly 1`] = `"<button aria-expanded=\\"true\\" class=\\"accordion-button collapsed\\">Default slot</button>"`;
3+
exports[`Loads and display CAccordionButton component renders correctly 1`] = `"<button type=\\"button\\" aria-expanded=\\"true\\" class=\\"accordion-button collapsed\\">Default slot</button>"`;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`Loads and display CAccordionHeader component renders correctly 1`] = `"<div class=\\"accordion-header\\"><button aria-expanded=\\"true\\" class=\\"accordion-button collapsed\\">Default slot</button></div>"`;
3+
exports[`Loads and display CAccordionHeader component renders correctly 1`] = `"<div class=\\"accordion-header\\"><button type=\\"button\\" aria-expanded=\\"true\\" class=\\"accordion-button collapsed\\">Default slot</button></div>"`;

packages/coreui-vue/src/components/button/__tests__/__snapshots__/CButton.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ exports[`Customize (number two) CButton component renders correctly 1`] = `"<a c
44
55
exports[`Customize CButton component renders correctly 1`] = `"<div class=\\"btn btn-outline-warning btn-lg active disabled rounded-pill\\" disabled=\\"true\\">Default slot</div>"`;
66
7-
exports[`Loads and display CButton component renders correctly 1`] = `"<button class=\\"btn btn-undefined\\">Default slot</button>"`;
7+
exports[`Loads and display CButton component renders correctly 1`] = `"<button class=\\"btn btn-undefined\\" type=\\"button\\">Default slot</button>"`;

packages/coreui-vue/src/components/dropdown/__tests__/CDropdownMenu.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
import { mount } from '@vue/test-utils'
22
import { CDropdownMenu as Component } from '../../../index'
3-
import { reactive, ref } from 'vue'
3+
import { ref } from 'vue'
44

55
const ComponentName = 'CDropdownMenu'
66

7-
const config = reactive({
7+
const config = {
88
alignment: { lg: 'end' },
99
dark: false,
1010
popper: true,
11-
visible: false,
12-
})
11+
}
1312

14-
const customConfig = reactive({
13+
const customConfig = {
1514
alignment: { lg: 'end' },
1615
dark: true,
1716
popper: false,
18-
visible: true,
19-
})
17+
}
2018

2119
const defaultWrapper = mount(Component, {
2220
propsData: {},
@@ -27,6 +25,7 @@ const defaultWrapper = mount(Component, {
2725
provide: {
2826
config: config,
2927
dropdownMenuRef: ref(),
28+
visible: ref(false),
3029
},
3130
},
3231
})
@@ -42,6 +41,7 @@ const customWrapper = mount(Component, {
4241
provide: {
4342
config: customConfig,
4443
dropdownMenuRef: ref(),
44+
visible: ref(true),
4545
},
4646
},
4747
})

packages/coreui-vue/src/components/dropdown/__tests__/CDropdownToggle.spec.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ const defaultWrapper = mount(Component, {
1818
},
1919
global: {
2020
provide: {
21-
dropdownRef: ref(),
21+
dropdownToggleRef: ref(),
2222
variant: 'input-group',
23-
visible: true,
23+
visible: ref(true),
2424
toggleMenu: function () {
2525
return true
2626
},
@@ -44,9 +44,9 @@ const customWrapper = mount(Component, {
4444
},
4545
global: {
4646
provide: {
47-
dropdownRef: ref(),
47+
dropdownToggleRef: ref(),
4848
variant: 'nav-item',
49-
visible: true,
49+
visible: ref(true),
5050
toggleMenu: function () {
5151
return true
5252
},
@@ -71,7 +71,6 @@ describe(`Loads and display ${ComponentName} component`, () => {
7171
expect(defaultWrapper.classes('active')).toBe(true)
7272
expect(defaultWrapper.classes('disabled')).toBe(true)
7373
expect(defaultWrapper.attributes('disabled')).toBe('')
74-
expect(defaultWrapper.attributes('active')).toBe('true')
7574
expect(defaultWrapper.find('span').classes('visually-hidden')).toBe(true)
7675
expect(defaultWrapper.find('span').text()).toContain('Toggle Dropdown')
7776
})
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`Customize CDropdownToggle component renders correctly 1`] = `"<a active=\\"true\\" class=\\"nav-link dropdown-toggle-split show active disabled\\" disabled=\\"true\\" href=\\"#\\">Default slot</a>"`;
3+
exports[`Customize CDropdownToggle component renders correctly 1`] = `"<a active=\\"true\\" class=\\"nav-link dropdown-toggle-split active disabled show\\" disabled=\\"true\\" href=\\"#\\">Default slot</a>"`;
44
5-
exports[`Loads and display CDropdownToggle component renders correctly 1`] = `"<button class=\\"dropdown-toggle dropdown-toggle-split show active disabled btn btn-outline-warning btn-lg rounded-pill\\" active=\\"true\\" disabled=\\"\\" type=\\"button\\"><span class=\\"visually-hidden\\">Toggle Dropdown</span></button>"`;
5+
exports[`Loads and display CDropdownToggle component renders correctly 1`] = `"<button class=\\"btn btn-outline-warning btn-lg active disabled rounded-pill dropdown-toggle dropdown-toggle-split active disabled show\\" disabled=\\"\\" type=\\"button\\"><span class=\\"visually-hidden\\">Toggle Dropdown</span></button>"`;
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`Customize with label - CFormCheck component renders correctly 1`] = `
4-
"<input class=\\"btn-check is-invalid is-valid\\" id=\\"uniqueid\\" type=\\"checkbox\\">
5-
<label class=\\"btn btn-outline-warning btn-lg rounded-circle\\" for=\\"uniqueid\\">some label</label>"
6-
`;
3+
exports[`Customize with label - CFormCheck component renders correctly 1`] = `"<input class=\\"btn-check is-invalid is-valid\\" id=\\"uniqueid\\" type=\\"checkbox\\"><label class=\\"btn btn-outline-warning btn-lg rounded-circle\\" for=\\"uniqueid\\">some label</label>"`;
74
8-
exports[`Customize with label in slot - CFormCheck component renders correctly 1`] = `
9-
"<input class=\\"btn-check is-invalid is-valid\\" id=\\"uniqueid\\" type=\\"checkbox\\">
10-
<label class=\\"btn btn-outline-warning btn-lg rounded-circle\\" for=\\"uniqueid\\">some label</label>"
11-
`;
5+
exports[`Customize with label in slot - CFormCheck component renders correctly 1`] = `"<input class=\\"btn-check is-invalid is-valid\\" id=\\"uniqueid\\" type=\\"checkbox\\"><label class=\\"btn btn-outline-warning btn-lg rounded-circle\\" for=\\"uniqueid\\">some label</label>"`;
126
137
exports[`Loads and display CFormCheck component renders correctly 1`] = `"<input class=\\"form-check-input\\" type=\\"checkbox\\">"`;

packages/coreui-vue/src/components/modal/__tests__/__snapshots__/CModal.spec.ts.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ exports[`Customize CModal component renders correctly 1`] = `
77
<div class=\\"modal-content bazinga\\">Default slot</div>
88
</div>
99
</div>
10-
</transition-stub>"
10+
</transition-stub>
11+
<!---->"
1112
`;
1213
1314
exports[`Loads and display CModal component renders correctly 1`] = `
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`Customize CSidebar component renders correctly 1`] = `"<div class=\\"sidebar sidebar-narrow sidebar-overlaid sidebar-fixed sidebar-xl sidebar-narrow-unfoldable\\">Default slot</div>"`;
3+
exports[`Customize CSidebar component renders correctly 1`] = `
4+
"<div class=\\"sidebar sidebar-narrow sidebar-overlaid sidebar-fixed sidebar-xl sidebar-narrow-unfoldable\\">Default slot</div>
5+
<!---->"
6+
`;
47
5-
exports[`Loads and display CSidebar component renders correctly 1`] = `"<div class=\\"sidebar hide\\">Default slot</div>"`;
8+
exports[`Loads and display CSidebar component renders correctly 1`] = `
9+
"<div class=\\"sidebar hide\\">Default slot</div>
10+
<!---->"
11+
`;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`Customize CToastClose component renders correctly 1`] = `"<button class=\\"btn btn-undefined\\">Default slot</button>"`;
3+
exports[`Customize CToastClose component renders correctly 1`] = `"<button class=\\"btn btn-undefined\\" type=\\"button\\">Default slot</button>"`;
44
55
exports[`Loads and display CToastClose component renders correctly 1`] = `"<button class=\\"btn btn-close\\" aria-label=\\"Close\\"></button>"`;

0 commit comments

Comments
 (0)