-
Notifications
You must be signed in to change notification settings - Fork 11
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
6 changed files
with
342 additions
and
120 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
157 changes: 157 additions & 0 deletions
157
src/liquid/components/ld-tabs/ld-tablist/test/__snapshots__/ld-tablist.spec.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,157 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ld-tablist modifiers mode 1`] = ` | ||
<ld-tablist mode="ghost" role="tablist"> | ||
<mock:shadow-root> | ||
<div class="ld-tablist ld-tablist--ghost" part="wrapper"> | ||
<button aria-disabled="true" class="ld-tablist__btn-scroll ld-tablist__btn-scroll--left" hidden="" part="arrow start" tabindex="-1"> | ||
<svg fill="none" height="16" part="arrow-icon start" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> | ||
<title> | ||
Scroll left | ||
</title> | ||
<path d="M10 13L6 8L10 3" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path> | ||
</svg> | ||
</button> | ||
<div class="ld-tablist__scroll-container" part="scroll-container"> | ||
<slot></slot> | ||
</div> | ||
<button aria-disabled="true" class="ld-tablist__btn-scroll ld-tablist__btn-scroll--right" hidden="" part="arrow end" tabindex="-1"> | ||
<svg fill="none" height="16" part="arrow-icon end" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> | ||
<title> | ||
Scroll right | ||
</title> | ||
<path d="M6 13L10 8L6 3" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path> | ||
</svg> | ||
</button> | ||
</div> | ||
</mock:shadow-root> | ||
<ld-tab selected=""> | ||
<mock:shadow-root> | ||
<button aria-selected="true" class="ld-tab" part="button" role="tab"> | ||
<span class="ld-tab__spacer" part="spacer start"></span> | ||
<span class="ld-tab__content" part="content"> | ||
<slot></slot> | ||
</span> | ||
<span class="ld-tab__spacer" part="spacer end"></span> | ||
</button> | ||
</mock:shadow-root> | ||
Fruits | ||
</ld-tab> | ||
<ld-tab> | ||
<mock:shadow-root> | ||
<button class="ld-tab" part="button" role="tab" tabindex="-1"> | ||
<span class="ld-tab__spacer" part="spacer start"></span> | ||
<span class="ld-tab__content" part="content"> | ||
<slot></slot> | ||
</span> | ||
<span class="ld-tab__spacer" part="spacer end"></span> | ||
</button> | ||
</mock:shadow-root> | ||
Vegetables | ||
</ld-tab> | ||
</ld-tablist> | ||
`; | ||
|
||
exports[`ld-tablist modifiers rounded 1`] = ` | ||
<ld-tablist role="tablist" rounded="all-lg"> | ||
<mock:shadow-root> | ||
<div class="ld-tablist ld-tablist--rounded-all-lg" part="wrapper"> | ||
<button aria-disabled="true" class="ld-tablist__btn-scroll ld-tablist__btn-scroll--left" hidden="" part="arrow start" tabindex="-1"> | ||
<svg fill="none" height="16" part="arrow-icon start" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> | ||
<title> | ||
Scroll left | ||
</title> | ||
<path d="M10 13L6 8L10 3" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path> | ||
</svg> | ||
</button> | ||
<div class="ld-tablist__scroll-container" part="scroll-container"> | ||
<slot></slot> | ||
</div> | ||
<button aria-disabled="true" class="ld-tablist__btn-scroll ld-tablist__btn-scroll--right" hidden="" part="arrow end" tabindex="-1"> | ||
<svg fill="none" height="16" part="arrow-icon end" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> | ||
<title> | ||
Scroll right | ||
</title> | ||
<path d="M6 13L10 8L6 3" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path> | ||
</svg> | ||
</button> | ||
</div> | ||
</mock:shadow-root> | ||
<ld-tab selected=""> | ||
<mock:shadow-root> | ||
<button aria-selected="true" class="ld-tab" part="button" role="tab"> | ||
<span class="ld-tab__spacer" part="spacer start"></span> | ||
<span class="ld-tab__content" part="content"> | ||
<slot></slot> | ||
</span> | ||
<span class="ld-tab__spacer" part="spacer end"></span> | ||
</button> | ||
</mock:shadow-root> | ||
Fruits | ||
</ld-tab> | ||
<ld-tab> | ||
<mock:shadow-root> | ||
<button class="ld-tab" part="button" role="tab" tabindex="-1"> | ||
<span class="ld-tab__spacer" part="spacer start"></span> | ||
<span class="ld-tab__content" part="content"> | ||
<slot></slot> | ||
</span> | ||
<span class="ld-tab__spacer" part="spacer end"></span> | ||
</button> | ||
</mock:shadow-root> | ||
Vegetables | ||
</ld-tab> | ||
</ld-tablist> | ||
`; | ||
|
||
exports[`ld-tablist modifiers size 1`] = ` | ||
<ld-tablist role="tablist" size="sm"> | ||
<mock:shadow-root> | ||
<div class="ld-tablist ld-tablist--sm" part="wrapper"> | ||
<button aria-disabled="true" class="ld-tablist__btn-scroll ld-tablist__btn-scroll--left" hidden="" part="arrow start" tabindex="-1"> | ||
<svg fill="none" height="16" part="arrow-icon start" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> | ||
<title> | ||
Scroll left | ||
</title> | ||
<path d="M10 13L6 8L10 3" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path> | ||
</svg> | ||
</button> | ||
<div class="ld-tablist__scroll-container" part="scroll-container"> | ||
<slot></slot> | ||
</div> | ||
<button aria-disabled="true" class="ld-tablist__btn-scroll ld-tablist__btn-scroll--right" hidden="" part="arrow end" tabindex="-1"> | ||
<svg fill="none" height="16" part="arrow-icon end" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> | ||
<title> | ||
Scroll right | ||
</title> | ||
<path d="M6 13L10 8L6 3" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path> | ||
</svg> | ||
</button> | ||
</div> | ||
</mock:shadow-root> | ||
<ld-tab selected=""> | ||
<mock:shadow-root> | ||
<button aria-selected="true" class="ld-tab" part="button" role="tab"> | ||
<span class="ld-tab__spacer" part="spacer start"></span> | ||
<span class="ld-tab__content" part="content"> | ||
<slot></slot> | ||
</span> | ||
<span class="ld-tab__spacer" part="spacer end"></span> | ||
</button> | ||
</mock:shadow-root> | ||
Fruits | ||
</ld-tab> | ||
<ld-tab> | ||
<mock:shadow-root> | ||
<button class="ld-tab" part="button" role="tab" tabindex="-1"> | ||
<span class="ld-tab__spacer" part="spacer start"></span> | ||
<span class="ld-tab__content" part="content"> | ||
<slot></slot> | ||
</span> | ||
<span class="ld-tab__spacer" part="spacer end"></span> | ||
</button> | ||
</mock:shadow-root> | ||
Vegetables | ||
</ld-tab> | ||
</ld-tablist> | ||
`; |
48 changes: 48 additions & 0 deletions
48
src/liquid/components/ld-tabs/ld-tablist/test/ld-tablist.spec.ts
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,48 @@ | ||
import { newSpecPage } from '@stencil/core/testing' | ||
import { LdTablist } from '../../ld-tablist/ld-tablist' | ||
import { LdTab } from '../../ld-tab/ld-tab' | ||
|
||
const components = [LdTablist, LdTab] | ||
|
||
describe('ld-tablist', () => { | ||
describe('modifiers', () => { | ||
it('size', async () => { | ||
const page = await newSpecPage({ | ||
components, | ||
html: ` | ||
<ld-tablist size="sm"> | ||
<ld-tab selected>Fruits</ld-tab> | ||
<ld-tab>Vegetables</ld-tab> | ||
</ld-tablist> | ||
`, | ||
}) | ||
expect(page.root).toMatchSnapshot() | ||
}) | ||
|
||
it('mode', async () => { | ||
const page = await newSpecPage({ | ||
components, | ||
html: ` | ||
<ld-tablist mode="ghost"> | ||
<ld-tab selected>Fruits</ld-tab> | ||
<ld-tab>Vegetables</ld-tab> | ||
</ld-tablist> | ||
`, | ||
}) | ||
expect(page.root).toMatchSnapshot() | ||
}) | ||
|
||
it('rounded', async () => { | ||
const page = await newSpecPage({ | ||
components, | ||
html: ` | ||
<ld-tablist rounded="all-lg"> | ||
<ld-tab selected>Fruits</ld-tab> | ||
<ld-tab>Vegetables</ld-tab> | ||
</ld-tablist> | ||
`, | ||
}) | ||
expect(page.root).toMatchSnapshot() | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.