Skip to content

Commit 7ad43e1

Browse files
committed
chore(compat): remove toBeInstanceOf assertions for Vue components
Vue3 compat build wraps component and transforms them. In order to mitigate this, replace `toBeInstanceOf` assertions with check of component name
1 parent 17ea50f commit 7ad43e1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/directives/popover/popover.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe('v-b-popover directive', () => {
7171

7272
// Should have instance of popover class on it
7373
expect($button.element[BV_POPOVER]).toBeDefined()
74-
expect($button.element[BV_POPOVER]).toBeInstanceOf(BVPopover)
74+
expect($button.element[BV_POPOVER].$options.name).toBe('BVPopover')
7575

7676
wrapper.destroy()
7777
})
@@ -105,7 +105,7 @@ describe('v-b-popover directive', () => {
105105

106106
// Should have instance of popover class on it
107107
expect($button.element[BV_POPOVER]).toBeDefined()
108-
expect($button.element[BV_POPOVER]).toBeInstanceOf(BVPopover)
108+
expect($button.element[BV_POPOVER].$options.name).toBe('BVPopover')
109109

110110
expect($button.attributes('aria-describedby')).toBeUndefined()
111111

src/directives/tooltip/tooltip.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe('v-b-tooltip directive', () => {
7171

7272
// Should have instance of popover class on it
7373
expect($button.element[BV_TOOLTIP]).toBeDefined()
74-
expect($button.element[BV_TOOLTIP]).toBeInstanceOf(BVTooltip)
74+
expect($button.element[BV_TOOLTIP].$options.name).toBe('BVTooltip')
7575

7676
wrapper.destroy()
7777
})
@@ -106,7 +106,7 @@ describe('v-b-tooltip directive', () => {
106106

107107
// Should have instance of popover class on it
108108
expect($button.element[BV_TOOLTIP]).toBeDefined()
109-
expect($button.element[BV_TOOLTIP]).toBeInstanceOf(BVTooltip)
109+
expect($button.element[BV_TOOLTIP].$options.name).toBe('BVTooltip')
110110

111111
expect($button.attributes('aria-describedby')).toBeUndefined()
112112

@@ -158,7 +158,7 @@ describe('v-b-tooltip directive', () => {
158158

159159
// Should have instance of popover class on it
160160
expect($button.element[BV_TOOLTIP]).toBeDefined()
161-
expect($button.element[BV_TOOLTIP]).toBeInstanceOf(BVTooltip)
161+
expect($button.element[BV_TOOLTIP].$options.name).toBe('BVTooltip')
162162

163163
expect($button.attributes('aria-describedby')).toBeUndefined()
164164

0 commit comments

Comments
 (0)