File tree Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Expand file tree Collapse file tree 2 files changed +17
-9
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 @@ -3,8 +3,17 @@ import '@testing-library/jest-dom'
3
3
import Stubs from './components/Stubs'
4
4
5
5
test ( 'Form contains search button' , ( ) => {
6
+ const DirectiveMock = {
7
+ template : '<p>fake template</p>' ,
8
+ }
9
+
6
10
const { getByText} = render ( Stubs , {
7
- stubs : [ 'FontAwesomeIcon' ] ,
11
+ global : {
12
+ stubs : {
13
+ directive : DirectiveMock ,
14
+ } ,
15
+ } ,
8
16
} )
17
+
9
18
expect ( getByText ( 'Search now' ) ) . toBeInTheDocument ( )
10
19
} )
You can’t perform that action at this time.
0 commit comments