-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
39783c0
commit afb9d52
Showing
20 changed files
with
6,085 additions
and
8,860 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
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
File renamed without changes.
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 @@ | ||
import './cosmoz-tabs'; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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,35 +1,41 @@ | ||
import { | ||
assert, html, fixture, nextFrame | ||
} from '@open-wc/testing'; | ||
|
||
import '../cosmoz-tabs.js'; | ||
import { assert, html, fixture, nextFrame } from '@open-wc/testing'; | ||
import { component } from 'haunted'; | ||
|
||
import '../src/cosmoz-tabs.js'; | ||
|
||
suiteSetup(() => { | ||
if (customElements.get('slot-test')) { | ||
return; | ||
} | ||
customElements.define('slot-test', component(() => html` | ||
<cosmoz-tabs> | ||
<cosmoz-tab name="tab0" heading="Tab0">1</cosmoz-tab> | ||
<slot></slot> | ||
</cosmoz-tabs> | ||
`)); | ||
customElements.define( | ||
'slot-test', | ||
component( | ||
() => html` | ||
<cosmoz-tabs> | ||
<cosmoz-tab name="tab0" heading="Tab0">1</cosmoz-tab> | ||
<slot></slot> | ||
</cosmoz-tabs> | ||
` | ||
) | ||
); | ||
}); | ||
|
||
suite('cosmoz-tabs slot', () => { | ||
test('collects cosmoz-tabs from slot', async () => { | ||
const el = await fixture(html` | ||
<slot-test> | ||
<cosmoz-tab name="tab1">2</cosmoz-tab> | ||
<span name="notatab2">3</span> | ||
</slot-test> | ||
`), | ||
<slot-test> | ||
<cosmoz-tab name="tab1">2</cosmoz-tab> | ||
<span name="notatab2">3</span> | ||
</slot-test> | ||
`), | ||
tabs = el.shadowRoot.querySelector('cosmoz-tabs'); | ||
await nextFrame(); | ||
await nextFrame(); | ||
tabs.selected = 'tab1'; | ||
await nextFrame(); | ||
assert.equal(el.querySelector('cosmoz-tab').getAttribute('is-selected'), ''); | ||
assert.equal( | ||
el.querySelector('cosmoz-tab').getAttribute('is-selected'), | ||
'' | ||
); | ||
}); | ||
}); |
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 @@ | ||
import { storybookPlugin } from '@web/dev-server-storybook'; | ||
|
||
export default { | ||
plugins: [storybookPlugin({ type: 'web-components' })], | ||
nodeResolve: true | ||
}; |