Skip to content

Commit 6e03a09

Browse files
committed
Fix stubs test
1 parent 779639d commit 6e03a09

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

src/__tests__/components/Stubs.vue

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
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
128
export default {
13-
name: 'SearchForm',
14-
components: { VButton }
9+
name: 'Stubs',
10+
11+
components: {
12+
Directive,
13+
},
1514
}
1615
</script>

src/__tests__/stubs.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@ import {render} from '@testing-library/vue'
22
import Stubs from './components/Stubs'
33

44
test('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
})

0 commit comments

Comments
 (0)