File tree 2 files changed +18
-10
lines changed
2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <form >
3
- <label for =" search" > <FontAwesomeIcon icon =" search" /> Search </label >
4
- <input id =" search" type =" text" name =" search" />
5
- <VButton text =" Search now" />
6
- </form >
2
+ <directive />
7
3
</template >
8
4
9
5
<script >
10
- import VButton from ' ./Button '
6
+ import Directive from ' ./Directive '
11
7
12
8
export default {
13
- name: ' SearchForm' ,
14
- components: { VButton }
9
+ name: ' Stubs' ,
10
+
11
+ components: {
12
+ Directive,
13
+ },
15
14
}
16
15
</script >
Original file line number Diff line number Diff line change @@ -2,8 +2,17 @@ import {render} from '@testing-library/vue'
2
2
import Stubs from './components/Stubs'
3
3
4
4
test ( 'Form contains search button' , ( ) => {
5
+ const DirectiveMock = {
6
+ template : '<p>fake template</p>' ,
7
+ }
8
+
5
9
const { getByText} = render ( Stubs , {
6
- stubs : [ 'FontAwesomeIcon' ] ,
10
+ global : {
11
+ stubs : {
12
+ directive : DirectiveMock ,
13
+ } ,
14
+ } ,
7
15
} )
8
- getByText ( 'Search now' )
16
+
17
+ getByText ( 'fake template' )
9
18
} )
You can’t perform that action at this time.
0 commit comments