This repository has been archived by the owner on Mar 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add scoped flag to slot descriptor (#118)
closes #31
- Loading branch information
1 parent
c0cb2db
commit f1be657
Showing
6 changed files
with
73 additions
and
1 deletion.
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,6 @@ | ||
<template> | ||
<div class="modal-footer"> | ||
<!-- @slot Modal footer here --> | ||
<slot name="footer" v-bind:item="item"/> | ||
</div> | ||
</template> |
11 changes: 11 additions & 0 deletions
11
tests/components/scoped-slot/__snapshots__/scoped-slot.test.ts.snap
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,11 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`tests wrapper with root slot should match the reference for the footer slot 1`] = ` | ||
Object { | ||
"bindings": Object { | ||
":item": "item", | ||
}, | ||
"description": "Modal footer here", | ||
"scoped": 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import * as path from 'path' | ||
import { ComponentDoc } from '../../../src/Documentation' | ||
import { parse } from '../../../src/main' | ||
|
||
const button = path.join(__dirname, './Wrapper.vue') | ||
let docButton: ComponentDoc | ||
|
||
describe('tests wrapper with root slot', () => { | ||
beforeEach(done => { | ||
docButton = parse(button) | ||
done() | ||
}) | ||
|
||
it('should have a slot.', () => { | ||
expect(Object.keys(docButton.slots).length).toEqual(1) | ||
}) | ||
|
||
it('should have a wrapper slot.', () => { | ||
expect(docButton.slots.footer.description).toBe('Modal footer here') | ||
}) | ||
|
||
it('should show the slot as scoped', () => { | ||
expect(docButton.slots.footer.scoped).toBeTruthy() | ||
}) | ||
|
||
it('should match the reference for the footer slot', () => { | ||
expect(docButton.slots.footer).toMatchSnapshot() | ||
}) | ||
}) |