File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import Card from './components/Card'
8
8
// in the render options are directly passed through to the Utils mount().
9
9
// For more, see: https://vue-test-utils.vuejs.org/api/options.html#slots
10
10
test ( 'Card component' , ( ) => {
11
- const { getByText } = render ( Card , {
11
+ const { getByText, queryByText } = render ( Card , {
12
12
slots : {
13
13
header : '<h1>HEADER</h1>' ,
14
14
footer : '<div>FOOTER</div>'
@@ -18,9 +18,14 @@ test('Card component', () => {
18
18
}
19
19
} )
20
20
21
- // The scoped prop "content" should be rendered in the given template above .
21
+ // The default slot should render the template above with the scoped prop "content" .
22
22
getByText ( 'Yay! Scoped content!' )
23
23
24
+ // Instead of the default slot's fallback content.
25
+ expect (
26
+ queryByText ( 'Nothing used the Scoped content!' )
27
+ ) . not . toBeInTheDocument ( )
28
+
24
29
// And the header and footer slots should be rendered with the given templates.
25
30
getByText ( 'HEADER' )
26
31
getByText ( 'FOOTER' )
You can’t perform that action at this time.
0 commit comments