Skip to content

Commit 87d2f15

Browse files
jacobmllr95tmorehouse
authored andcommitted
chore: tests cleanup (#3018)
1 parent 3b2fe73 commit 87d2f15

File tree

100 files changed

+1765
-1775
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+1765
-1775
lines changed

src/components/alert/alert.spec.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import Alert from './alert'
1+
import BAlert from './alert'
22
import { mount } from '@vue/test-utils'
33

44
describe('alert', () => {
55
it('hidden alert renders comment node', async () => {
6-
const wrapper = mount(Alert)
6+
const wrapper = mount(BAlert)
77
expect(wrapper.isVueInstance()).toBe(true)
88
await wrapper.vm.$nextTick()
99
expect(wrapper.isEmpty()).toBe(true)
@@ -13,7 +13,7 @@ describe('alert', () => {
1313
})
1414

1515
it('hidden alert (show = "0") renders comment node', async () => {
16-
const wrapper = mount(Alert, {
16+
const wrapper = mount(BAlert, {
1717
propsData: {
1818
show: '0'
1919
}
@@ -27,7 +27,7 @@ describe('alert', () => {
2727
})
2828

2929
it('hidden alert (show = 0) renders comment node', async () => {
30-
const wrapper = mount(Alert, {
30+
const wrapper = mount(BAlert, {
3131
propsData: {
3232
show: 0
3333
}
@@ -41,7 +41,7 @@ describe('alert', () => {
4141
})
4242

4343
it('visible alert has default class names and attributes', async () => {
44-
const wrapper = mount(Alert, {
44+
const wrapper = mount(BAlert, {
4545
propsData: {
4646
show: true
4747
}
@@ -65,7 +65,7 @@ describe('alert', () => {
6565
})
6666

6767
it('visible alert (show = "") has default class names and attributes', async () => {
68-
const wrapper = mount(Alert, {
68+
const wrapper = mount(BAlert, {
6969
propsData: {
7070
show: ''
7171
}
@@ -89,7 +89,7 @@ describe('alert', () => {
8989
})
9090

9191
it('visible alert has variant when prop variant is set', async () => {
92-
const wrapper = mount(Alert, {
92+
const wrapper = mount(BAlert, {
9393
propsData: {
9494
show: true,
9595
variant: 'success'
@@ -110,7 +110,7 @@ describe('alert', () => {
110110
})
111111

112112
it('renders content from default slot', async () => {
113-
const wrapper = mount(Alert, {
113+
const wrapper = mount(BAlert, {
114114
propsData: {
115115
show: true
116116
},
@@ -130,7 +130,7 @@ describe('alert', () => {
130130
})
131131

132132
it('hidden alert shows when show prop set', async () => {
133-
const wrapper = mount(Alert)
133+
const wrapper = mount(BAlert)
134134

135135
expect(wrapper.isVueInstance()).toBe(true)
136136
await wrapper.vm.$nextTick()
@@ -151,7 +151,7 @@ describe('alert', () => {
151151
})
152152

153153
it('dismissible alert should have class alert-dismissible', async () => {
154-
const wrapper = mount(Alert, {
154+
const wrapper = mount(BAlert, {
155155
propsData: {
156156
show: true,
157157
dismissible: true
@@ -168,7 +168,7 @@ describe('alert', () => {
168168
})
169169

170170
it('dismissible alert should have close button', async () => {
171-
const wrapper = mount(Alert, {
171+
const wrapper = mount(BAlert, {
172172
propsData: {
173173
show: true,
174174
dismissible: true
@@ -185,7 +185,7 @@ describe('alert', () => {
185185
})
186186

187187
it('dismissible alert should have close button with custom aria-label', async () => {
188-
const wrapper = mount(Alert, {
188+
const wrapper = mount(BAlert, {
189189
propsData: {
190190
show: true,
191191
dismissible: true,
@@ -203,7 +203,7 @@ describe('alert', () => {
203203
})
204204

205205
it('dismiss button click should close alert', async () => {
206-
const wrapper = mount(Alert, {
206+
const wrapper = mount(BAlert, {
207207
propsData: {
208208
show: true,
209209
dismissible: true
@@ -234,13 +234,13 @@ describe('alert', () => {
234234
})
235235

236236
it('should have class fade when prop fade=true', async () => {
237-
const wrapper = mount(Alert, {
237+
const wrapper = mount(BAlert, {
238238
propsData: {
239239
show: true,
240240
fade: true
241241
},
242242
stubs: {
243-
// the builtin stub doesn't execute the transition hooks
243+
// The builtin stub doesn't execute the transition hooks
244244
// so we let it use the real transition component
245245
transition: false
246246
}
@@ -259,13 +259,13 @@ describe('alert', () => {
259259
})
260260

261261
it('fade transition works', async () => {
262-
const wrapper = mount(Alert, {
262+
const wrapper = mount(BAlert, {
263263
propsData: {
264264
show: false,
265265
fade: true
266266
},
267267
stubs: {
268-
// the builtin stub doesn't execute the transition hooks
268+
// The builtin stub doesn't execute the transition hooks
269269
// so we let it use the real transition component
270270
transition: false
271271
}
@@ -293,7 +293,7 @@ describe('alert', () => {
293293
await wrapper.vm.$nextTick()
294294
await new Promise(resolve => requestAnimationFrame(resolve))
295295

296-
// dismissed wont be emitted unless dismissible=true or show is a number
296+
// Dismissed won't be emitted unless dismissible=true or show is a number
297297
expect(wrapper.emitted('dismissed')).not.toBeDefined()
298298

299299
expect(wrapper.isEmpty()).toBe(true)
@@ -304,7 +304,7 @@ describe('alert', () => {
304304

305305
it('dismiss countdown emits dismiss-count-down event', async () => {
306306
jest.useFakeTimers()
307-
const wrapper = mount(Alert, {
307+
const wrapper = mount(BAlert, {
308308
propsData: {
309309
show: 3
310310
}
@@ -341,7 +341,7 @@ describe('alert', () => {
341341

342342
it('dismiss countdown emits dismiss-count-down event when show is number as string', async () => {
343343
jest.useFakeTimers()
344-
const wrapper = mount(Alert, {
344+
const wrapper = mount(BAlert, {
345345
propsData: {
346346
show: '3'
347347
}
@@ -378,7 +378,7 @@ describe('alert', () => {
378378

379379
it('dismiss countdown handles when show value is changed', async () => {
380380
jest.useFakeTimers()
381-
const wrapper = mount(Alert, {
381+
const wrapper = mount(BAlert, {
382382
propsData: {
383383
show: 2
384384
}
@@ -430,7 +430,7 @@ describe('alert', () => {
430430

431431
it('dismiss countdown handles when alert dismissed early', async () => {
432432
jest.useFakeTimers()
433-
const wrapper = mount(Alert, {
433+
const wrapper = mount(BAlert, {
434434
propsData: {
435435
show: 2,
436436
dismissible: true

src/components/badge/badge.spec.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import Badge from './badge'
1+
import BBadge from './badge'
22
import { mount } from '@vue/test-utils'
33

44
describe('badge', () => {
55
it('should have base classes', async () => {
6-
const wrapper = mount(Badge)
6+
const wrapper = mount(BBadge)
77
expect(wrapper.is('span')).toBe(true)
88
expect(wrapper.classes()).toContain('badge')
99
expect(wrapper.classes()).toContain('badge-secondary')
@@ -14,7 +14,7 @@ describe('badge', () => {
1414
})
1515

1616
it('should have default slot content', async () => {
17-
const wrapper = mount(Badge, {
17+
const wrapper = mount(BBadge, {
1818
slots: {
1919
default: 'foobar'
2020
}
@@ -30,7 +30,7 @@ describe('badge', () => {
3030
})
3131

3232
it('should apply variant class', async () => {
33-
const wrapper = mount(Badge, {
33+
const wrapper = mount(BBadge, {
3434
propsData: {
3535
variant: 'danger'
3636
}
@@ -44,7 +44,7 @@ describe('badge', () => {
4444
})
4545

4646
it('should apply pill class', async () => {
47-
const wrapper = mount(Badge, {
47+
const wrapper = mount(BBadge, {
4848
propsData: {
4949
pill: true
5050
}
@@ -58,7 +58,7 @@ describe('badge', () => {
5858
})
5959

6060
it('should have active class when prop active set', async () => {
61-
const wrapper = mount(Badge, {
61+
const wrapper = mount(BBadge, {
6262
propsData: {
6363
active: true
6464
}
@@ -72,7 +72,7 @@ describe('badge', () => {
7272
})
7373

7474
it('should have disabled class when prop disabled set', async () => {
75-
const wrapper = mount(Badge, {
75+
const wrapper = mount(BBadge, {
7676
propsData: {
7777
disabled: true
7878
}
@@ -86,7 +86,7 @@ describe('badge', () => {
8686
})
8787

8888
it('renders custom root element', async () => {
89-
const wrapper = mount(Badge, {
89+
const wrapper = mount(BBadge, {
9090
propsData: {
9191
tag: 'small'
9292
}
@@ -100,7 +100,7 @@ describe('badge', () => {
100100
})
101101

102102
it('renders link when href provided', async () => {
103-
const wrapper = mount(Badge, {
103+
const wrapper = mount(BBadge, {
104104
propsData: {
105105
href: '/foo/bar'
106106
}

src/components/breadcrumb/breadcrumb-item.spec.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import BreadcrumbItem from './breadcrumb-item'
1+
import BBreadcrumbItem from './breadcrumb-item'
22
import { mount } from '@vue/test-utils'
33

44
describe('breadcrumb-item', () => {
55
it('has default classes and structure', async () => {
6-
const wrapper = mount(BreadcrumbItem)
6+
const wrapper = mount(BBreadcrumbItem)
77
expect(wrapper.is('li')).toBe(true)
88
expect(wrapper.classes()).toContain('breadcrumb-item')
99
expect(wrapper.classes()).not.toContain('active')
1010
expect(wrapper.classes().length).toBe(1)
1111
})
1212

1313
it('has class active when prop active is set', async () => {
14-
const wrapper = mount(BreadcrumbItem, {
14+
const wrapper = mount(BBreadcrumbItem, {
1515
propsData: {
1616
active: true
1717
}
@@ -23,14 +23,14 @@ describe('breadcrumb-item', () => {
2323
})
2424

2525
it('has link as child', async () => {
26-
const wrapper = mount(BreadcrumbItem)
26+
const wrapper = mount(BBreadcrumbItem)
2727
expect(wrapper.is('li')).toBe(true)
2828
expect(wrapper.find('a').exists()).toBe(true)
2929
expect(wrapper.find('a').attributes('href')).toBe('#')
3030
})
3131

3232
it('has link as child and href', async () => {
33-
const wrapper = mount(BreadcrumbItem, {
33+
const wrapper = mount(BBreadcrumbItem, {
3434
propsData: {
3535
href: '/foo/bar'
3636
}
@@ -41,7 +41,7 @@ describe('breadcrumb-item', () => {
4141
})
4242

4343
it('has child span and class active when prop active is set', async () => {
44-
const wrapper = mount(BreadcrumbItem, {
44+
const wrapper = mount(BBreadcrumbItem, {
4545
propsData: {
4646
active: true
4747
}
@@ -54,7 +54,7 @@ describe('breadcrumb-item', () => {
5454
})
5555

5656
it('has child text content from prop text', async () => {
57-
const wrapper = mount(BreadcrumbItem, {
57+
const wrapper = mount(BBreadcrumbItem, {
5858
propsData: {
5959
active: true,
6060
text: 'foobar'
@@ -68,7 +68,7 @@ describe('breadcrumb-item', () => {
6868
})
6969

7070
it('has child text content from prop html', async () => {
71-
const wrapper = mount(BreadcrumbItem, {
71+
const wrapper = mount(BBreadcrumbItem, {
7272
propsData: {
7373
active: true,
7474
html: 'foobar'
@@ -82,7 +82,7 @@ describe('breadcrumb-item', () => {
8282
})
8383

8484
it('has child text content from default slot', async () => {
85-
const wrapper = mount(BreadcrumbItem, {
85+
const wrapper = mount(BBreadcrumbItem, {
8686
propsData: {
8787
active: true
8888
},

0 commit comments

Comments
 (0)