Skip to content

Commit 7a43d50

Browse files
committed
Fix test warnings
1 parent 9c1a832 commit 7a43d50

File tree

2 files changed

+54
-3
lines changed

2 files changed

+54
-3
lines changed

tests/components/Block.test.ts

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ describe('Block.vue', () => {
1111
const sampleMarkdown = `**${sampleText}**`
1212
const outputHtml = `<strong>${sampleText}</strong>`
1313
const wrapper = mount(BlockComponent, {
14+
global: {
15+
stubs: ['v-icon'],
16+
},
1417
props: {
1518
block: {
1619
type: BlockType.Text,
@@ -32,6 +35,9 @@ describe('Block.vue', () => {
3235
it("should move cursor correctly - moveToStart, moveToEnd", async () => {
3336
const sampleText = 'Hello, world!'
3437
const wrapper = mount(BlockComponent, {
38+
global: {
39+
stubs: ['v-icon'],
40+
},
3541
props: {
3642
block: {
3743
type: BlockType.Text,
@@ -73,6 +79,9 @@ describe('Block.vue', () => {
7379
const sampleTextA = 'Hello'
7480
const sampleTextB = ', world!'
7581
const wrapper = mount(BlockComponent, {
82+
global: {
83+
stubs: ['v-icon'],
84+
},
7685
props: {
7786
block: {
7887
type: BlockType.Text,
@@ -127,7 +136,11 @@ describe('Block.vue', () => {
127136
})
128137

129138
it("should emit correct events on arrow navigation", async () => {
130-
const wrapper = mount(BlockComponent)
139+
const wrapper = mount(BlockComponent, {
140+
global: {
141+
stubs: ['v-icon'],
142+
},
143+
})
131144
await new Promise<void>(r => {
132145
setTimeout(async () => {
133146
wrapper.vm.moveToStart()
@@ -153,7 +166,11 @@ describe('Block.vue', () => {
153166
})
154167

155168
it("should emit correct events on backspace / enter", async () => {
156-
const wrapper = mount(BlockComponent)
169+
const wrapper = mount(BlockComponent, {
170+
global: {
171+
stubs: ['v-icon'],
172+
},
173+
})
157174
await new Promise<void>(r => {
158175
setTimeout(async () => {
159176
wrapper.vm.moveToStart()
@@ -172,6 +189,9 @@ describe('Block.vue', () => {
172189

173190
it("should change to H1 on #", async () => {
174191
const wrapper = mount(BlockComponent, {
192+
global: {
193+
stubs: ['v-icon'],
194+
},
175195
props: {
176196
block: {
177197
type: BlockType.Text,
@@ -193,6 +213,9 @@ describe('Block.vue', () => {
193213

194214
it("should change to H2 on ##", async () => {
195215
const wrapper = mount(BlockComponent, {
216+
global: {
217+
stubs: ['v-icon'],
218+
},
196219
props: {
197220
block: {
198221
type: BlockType.Text,
@@ -214,6 +237,9 @@ describe('Block.vue', () => {
214237

215238
it("should change to H3 on ###", async () => {
216239
const wrapper = mount(BlockComponent, {
240+
global: {
241+
stubs: ['v-icon'],
242+
},
217243
props: {
218244
block: {
219245
type: BlockType.Text,
@@ -235,6 +261,9 @@ describe('Block.vue', () => {
235261

236262
it("should change to Quote on >", async () => {
237263
const wrapper = mount(BlockComponent, {
264+
global: {
265+
stubs: ['v-icon'],
266+
},
238267
props: {
239268
block: {
240269
type: BlockType.Text,
@@ -256,6 +285,9 @@ describe('Block.vue', () => {
256285

257286
it("should change to Divider on ---", async () => {
258287
const wrapper = mount(BlockComponent, {
288+
global: {
289+
stubs: ['v-icon'],
290+
},
259291
props: {
260292
block: {
261293
type: BlockType.H1,
@@ -276,7 +308,11 @@ describe('Block.vue', () => {
276308
})
277309

278310
it("should render default blockType and content without props", async () => {
279-
const wrapper = mount(BlockComponent)
311+
const wrapper = mount(BlockComponent, {
312+
global: {
313+
stubs: ['v-icon'],
314+
},
315+
})
280316
await new Promise<void>(r => {
281317
setTimeout(() => {
282318
expect(wrapper.vm.block.type).toBe(BlockType.Text)
@@ -289,6 +325,9 @@ describe('Block.vue', () => {
289325

290326
it("should render BlockType.Divider without content", async () => {
291327
const wrapper = mount(BlockComponent, {
328+
global: {
329+
stubs: ['v-icon'],
330+
},
292331
props: {
293332
block: {
294333
type: BlockType.Divider,

tests/components/BlockMenu.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ describe('BlockMenu.vue', () => {
77

88
it("should open/close according to click events", async () => {
99
const wrapper = mount(BlockMenu, {
10+
global: {
11+
stubs: ['v-icon'],
12+
},
1013
props: {
1114
blockTypes: ['TEXT', 'QUOTE'],
1215
}
@@ -42,6 +45,9 @@ describe('BlockMenu.vue', () => {
4245

4346
it("should respond to keyboard navigation", async () => {
4447
const wrapper = mount(BlockMenu, {
48+
global: {
49+
stubs: ['v-icon'],
50+
},
4551
props: {
4652
blockTypes: ['TEXT', 'QUOTE'],
4753
}
@@ -84,6 +90,9 @@ describe('BlockMenu.vue', () => {
8490

8591
it('should support search', async () => {
8692
const wrapper = mount(BlockMenu, {
93+
global: {
94+
stubs: ['v-icon'],
95+
},
8796
props: {
8897
blockTypes: ['TEXT', 'QUOTE'],
8998
}
@@ -108,6 +117,9 @@ describe('BlockMenu.vue', () => {
108117

109118
it('should emit setBlockType', async () => {
110119
const wrapper = mount(BlockMenu, {
120+
global: {
121+
stubs: ['v-icon'],
122+
},
111123
props: {
112124
blockTypes: ['TEXT', 'QUOTE'],
113125
}

0 commit comments

Comments
 (0)