Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b84b782

Browse files
author
Matthew Bell
committed
assert fallback content is not in DOM, rephrase comments to clarify
1 parent 11b1188 commit b84b782

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎tests/__tests__/slots.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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
1010
test('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')

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /