-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
1,013 additions
and
1,149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
sourceType: 'module', | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { | ||
node: 'current', | ||
esmodules: true, | ||
}, | ||
}, | ||
], | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,17 @@ | ||
import '@testing-library/jest-dom' | ||
import {render} from '@testing-library/vue' | ||
import {render} from '..' | ||
import Card from './components/Card' | ||
|
||
// In this test file we demo how to test a component with slots and a scoped slot. | ||
|
||
// Usage is the same as Vue Test Utils, since slots and scopedSlots | ||
// in the render options are directly passed through to the Utils mount(). | ||
// For more, see: https://vue-test-utils.vuejs.org/api/options.html#slots | ||
// Usage is the same as Vue Test Utils, since slots values are passed using the `slots` | ||
// key from mount(). For more, see: https://vue-test-utils.vuejs.org/api/options.html#slots | ||
test('Card component', () => { | ||
const {getByText, queryByText} = render(Card, { | ||
const {getByText} = render(Card, { | ||
slots: { | ||
header: '<h1>HEADER</h1>', | ||
footer: '<div>FOOTER</div>', | ||
}, | ||
scopedSlots: { | ||
default: '<p>Yay! {{props.content}}</p>', | ||
}, | ||
}) | ||
|
||
// The default slot should render the template above with the scoped prop "content". | ||
expect(getByText('Yay! Scoped content!')).toBeInTheDocument() | ||
|
||
// Instead of the default slot's fallback content. | ||
expect( | ||
queryByText('Nothing used the Scoped content!'), | ||
).not.toBeInTheDocument() | ||
|
||
// And the header and footer slots should be rendered with the given templates. | ||
expect(getByText('HEADER')).toBeInTheDocument() | ||
expect(getByText('FOOTER')).toBeInTheDocument() | ||
}) |
Oops, something went wrong.