-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: tag group migration to Lit
- Loading branch information
1 parent
05c14a7
commit 1e0aac3
Showing
10 changed files
with
433 additions
and
464 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './sbb-tag-group'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,51 @@ | ||
import { SbbTagGroup } from './sbb-tag-group'; | ||
import { newSpecPage } from '@stencil/core/testing'; | ||
import { expect, fixture } from '@open-wc/testing'; | ||
import { html } from 'lit/static-html.js'; | ||
import './sbb-tag-group'; | ||
|
||
describe('sbb-tag-group', () => { | ||
it('renders', async () => { | ||
const { root } = await newSpecPage({ | ||
components: [SbbTagGroup], | ||
html: ` | ||
<sbb-tag-group> | ||
<sbb-tag value="tag-1">First tag</sbb-tag> | ||
<sbb-tag value="tag-2">Second tag</sbb-tag> | ||
<sbb-tag value="tag-3">Third tag</sbb-tag> | ||
</sbb-tag-group> | ||
`, | ||
}); | ||
|
||
expect(root).toEqualHtml(` | ||
<sbb-tag-group role="group"> | ||
<mock:shadow-root> | ||
<div class="sbb-tag-group"> | ||
<ul class="sbb-tag-group__list"> | ||
<li class="sbb-tag-group__list-item"> | ||
<slot name="tag-0"></slot> | ||
</li> | ||
<li class="sbb-tag-group__list-item"> | ||
<slot name="tag-1"></slot> | ||
</li> | ||
<li class="sbb-tag-group__list-item"> | ||
<slot name="tag-2"></slot> | ||
</li> | ||
</ul> | ||
<span hidden=""> | ||
<slot></slot> | ||
</span> | ||
</div> | ||
</mock:shadow-root> | ||
<sbb-tag slot="tag-0" value="tag-1"> | ||
First tag | ||
</sbb-tag> | ||
<sbb-tag slot="tag-1" value="tag-2"> | ||
Second tag | ||
</sbb-tag> | ||
<sbb-tag slot="tag-2" value="tag-3"> | ||
Third tag | ||
</sbb-tag> | ||
const root = await fixture(html` | ||
<sbb-tag-group> | ||
<sbb-tag value="tag-1">First tag</sbb-tag> | ||
<sbb-tag value="tag-2">Second tag</sbb-tag> | ||
<sbb-tag value="tag-3">Third tag</sbb-tag> | ||
</sbb-tag-group> | ||
`); | ||
|
||
expect(root).dom.to.be.equal( | ||
` | ||
<sbb-tag-group role="group"> | ||
<sbb-tag slot="tag-0" value="tag-1"> | ||
First tag | ||
</sbb-tag> | ||
<sbb-tag slot="tag-1" value="tag-2"> | ||
Second tag | ||
</sbb-tag> | ||
<sbb-tag slot="tag-2" value="tag-3"> | ||
Third tag | ||
</sbb-tag> | ||
</sbb-tag-group> | ||
`, | ||
); | ||
expect(root).shadowDom.to.be.equal( | ||
` | ||
<div class="sbb-tag-group"> | ||
<ul class="sbb-tag-group__list"> | ||
<li class="sbb-tag-group__list-item"> | ||
<slot name="tag-0"></slot> | ||
</li> | ||
<li class="sbb-tag-group__list-item"> | ||
<slot name="tag-1"></slot> | ||
</li> | ||
<li class="sbb-tag-group__list-item"> | ||
<slot name="tag-2"></slot> | ||
</li> | ||
</ul> | ||
<span hidden=""> | ||
<slot></slot> | ||
</span> | ||
</div> | ||
`, | ||
); | ||
}); | ||
}); |
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 @@ | ||
export * from './sbb-tag'; |
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
Oops, something went wrong.