@@ -11,6 +11,9 @@ describe('Block.vue', () => {
11
11
const sampleMarkdown = `**${ sampleText } **`
12
12
const outputHtml = `<strong>${ sampleText } </strong>`
13
13
const wrapper = mount ( BlockComponent , {
14
+ global : {
15
+ stubs : [ 'v-icon' ] ,
16
+ } ,
14
17
props : {
15
18
block : {
16
19
type : BlockType . Text ,
@@ -32,6 +35,9 @@ describe('Block.vue', () => {
32
35
it ( "should move cursor correctly - moveToStart, moveToEnd" , async ( ) => {
33
36
const sampleText = 'Hello, world!'
34
37
const wrapper = mount ( BlockComponent , {
38
+ global : {
39
+ stubs : [ 'v-icon' ] ,
40
+ } ,
35
41
props : {
36
42
block : {
37
43
type : BlockType . Text ,
@@ -73,6 +79,9 @@ describe('Block.vue', () => {
73
79
const sampleTextA = 'Hello'
74
80
const sampleTextB = ', world!'
75
81
const wrapper = mount ( BlockComponent , {
82
+ global : {
83
+ stubs : [ 'v-icon' ] ,
84
+ } ,
76
85
props : {
77
86
block : {
78
87
type : BlockType . Text ,
@@ -127,7 +136,11 @@ describe('Block.vue', () => {
127
136
} )
128
137
129
138
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
+ } )
131
144
await new Promise < void > ( r => {
132
145
setTimeout ( async ( ) => {
133
146
wrapper . vm . moveToStart ( )
@@ -153,7 +166,11 @@ describe('Block.vue', () => {
153
166
} )
154
167
155
168
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
+ } )
157
174
await new Promise < void > ( r => {
158
175
setTimeout ( async ( ) => {
159
176
wrapper . vm . moveToStart ( )
@@ -172,6 +189,9 @@ describe('Block.vue', () => {
172
189
173
190
it ( "should change to H1 on #" , async ( ) => {
174
191
const wrapper = mount ( BlockComponent , {
192
+ global : {
193
+ stubs : [ 'v-icon' ] ,
194
+ } ,
175
195
props : {
176
196
block : {
177
197
type : BlockType . Text ,
@@ -193,6 +213,9 @@ describe('Block.vue', () => {
193
213
194
214
it ( "should change to H2 on ##" , async ( ) => {
195
215
const wrapper = mount ( BlockComponent , {
216
+ global : {
217
+ stubs : [ 'v-icon' ] ,
218
+ } ,
196
219
props : {
197
220
block : {
198
221
type : BlockType . Text ,
@@ -214,6 +237,9 @@ describe('Block.vue', () => {
214
237
215
238
it ( "should change to H3 on ###" , async ( ) => {
216
239
const wrapper = mount ( BlockComponent , {
240
+ global : {
241
+ stubs : [ 'v-icon' ] ,
242
+ } ,
217
243
props : {
218
244
block : {
219
245
type : BlockType . Text ,
@@ -235,6 +261,9 @@ describe('Block.vue', () => {
235
261
236
262
it ( "should change to Quote on >" , async ( ) => {
237
263
const wrapper = mount ( BlockComponent , {
264
+ global : {
265
+ stubs : [ 'v-icon' ] ,
266
+ } ,
238
267
props : {
239
268
block : {
240
269
type : BlockType . Text ,
@@ -256,6 +285,9 @@ describe('Block.vue', () => {
256
285
257
286
it ( "should change to Divider on ---" , async ( ) => {
258
287
const wrapper = mount ( BlockComponent , {
288
+ global : {
289
+ stubs : [ 'v-icon' ] ,
290
+ } ,
259
291
props : {
260
292
block : {
261
293
type : BlockType . H1 ,
@@ -276,7 +308,11 @@ describe('Block.vue', () => {
276
308
} )
277
309
278
310
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
+ } )
280
316
await new Promise < void > ( r => {
281
317
setTimeout ( ( ) => {
282
318
expect ( wrapper . vm . block . type ) . toBe ( BlockType . Text )
@@ -289,6 +325,9 @@ describe('Block.vue', () => {
289
325
290
326
it ( "should render BlockType.Divider without content" , async ( ) => {
291
327
const wrapper = mount ( BlockComponent , {
328
+ global : {
329
+ stubs : [ 'v-icon' ] ,
330
+ } ,
292
331
props : {
293
332
block : {
294
333
type : BlockType . Divider ,
0 commit comments