File tree Expand file tree Collapse file tree 2 files changed +18
-10
lines changed
Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 11<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 />
73</template >
84
95<script >
10- import VButton from ' ./Button '
6+ import Directive from ' ./Directive '
117
128export default {
13- name: ' SearchForm' ,
14- components: { VButton }
9+ name: ' Stubs' ,
10+
11+ components: {
12+ Directive,
13+ },
1514}
1615 </script >
Original file line number Diff line number Diff line change @@ -2,8 +2,17 @@ import {render} from '@testing-library/vue'
22import Stubs from './components/Stubs'
33
44test ( 'Form contains search button' , ( ) => {
5+ const DirectiveMock = {
6+ template : '<p>fake template</p>' ,
7+ }
8+
59 const { getByText} = render ( Stubs , {
6- stubs : [ 'FontAwesomeIcon' ] ,
10+ global : {
11+ stubs : {
12+ directive : DirectiveMock ,
13+ } ,
14+ } ,
715 } )
8- getByText ( 'Search now' )
16+
17+ getByText ( 'fake template' )
918} )
You can’t perform that action at this time.
0 commit comments