File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 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'
88// in the render options are directly passed through to the Utils mount().
99// For more, see: https://vue-test-utils.vuejs.org/api/options.html#slots
1010test ( 'Card component' , ( ) => {
11- const { getByText } = render ( Card , {
11+ const { getByText, queryByText } = render ( Card , {
1212 slots : {
1313 header : '<h1>HEADER</h1>' ,
1414 footer : '<div>FOOTER</div>'
@@ -18,9 +18,14 @@ test('Card component', () => {
1818 }
1919 } )
2020
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" .
2222 getByText ( 'Yay! Scoped content!' )
2323
24+ // Instead of the default slot's fallback content.
25+ expect (
26+ queryByText ( 'Nothing used the Scoped content!' )
27+ ) . not . toBeInTheDocument ( )
28+
2429 // And the header and footer slots should be rendered with the given templates.
2530 getByText ( 'HEADER' )
2631 getByText ( 'FOOTER' )
You can’t perform that action at this time.
0 commit comments