-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(sbb-breadcrumb): support SSR and hydration (#2224)
- Loading branch information
1 parent
0555549
commit e38ee8a
Showing
11 changed files
with
196 additions
and
151 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 |
---|---|---|
@@ -1,9 +1,6 @@ | ||
dist/ | ||
loader/ | ||
hydrate/ | ||
src/components.d.ts | ||
www/ | ||
tools/generate-component/boilerplate/ | ||
**/__snapshots__/ | ||
|
||
# not ignored folders/files | ||
!.github/ |
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,5 +1,6 @@ | ||
coverage | ||
dist | ||
**/__snapshots__ | ||
|
||
# needed for apexes in `HTMLElementTagNameMap`, which otherwise would be stripped | ||
tools/generate-component/boilerplate/component.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
91 changes: 91 additions & 0 deletions
91
src/components/breadcrumb/breadcrumb/__snapshots__/breadcrumb.spec.snap.js
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,91 @@ | ||
/* @web/test-runner snapshot v1 */ | ||
export const snapshots = {}; | ||
|
||
snapshots["sbb-breadcrumb renders with text"] = | ||
`<a | ||
class="sbb-breadcrumb" | ||
download="" | ||
href="/test" | ||
rel="subsection" | ||
role="presentation" | ||
tabindex="-1" | ||
target="_blank" | ||
> | ||
<slot name="icon"> | ||
</slot> | ||
<span class="sbb-breadcrumb__label"> | ||
<slot> | ||
</slot> | ||
</span> | ||
<span class="sbb-breadcrumb__label--opens-in-new-window"> | ||
. Link target opens in new window. | ||
</span> | ||
</a> | ||
`; | ||
/* end snapshot sbb-breadcrumb renders with text */ | ||
|
||
snapshots["sbb-breadcrumb renders with icon"] = | ||
`<a | ||
class="sbb-breadcrumb" | ||
href="/" | ||
role="presentation" | ||
tabindex="-1" | ||
> | ||
<slot name="icon"> | ||
<sbb-icon | ||
aria-hidden="true" | ||
class="sbb-breadcrumb__icon" | ||
data-namespace="default" | ||
name="house-small" | ||
role="img" | ||
> | ||
</sbb-icon> | ||
</slot> | ||
<span | ||
class="sbb-breadcrumb__label" | ||
hidden="" | ||
> | ||
<slot> | ||
</slot> | ||
</span> | ||
</a> | ||
`; | ||
/* end snapshot sbb-breadcrumb renders with icon */ | ||
|
||
snapshots["sbb-breadcrumb renders with icon and text"] = | ||
`<a | ||
class="sbb-breadcrumb" | ||
href="/" | ||
role="presentation" | ||
tabindex="-1" | ||
> | ||
<slot name="icon"> | ||
<sbb-icon | ||
aria-hidden="true" | ||
class="sbb-breadcrumb__icon" | ||
data-namespace="default" | ||
name="house-small" | ||
role="img" | ||
> | ||
</sbb-icon> | ||
</slot> | ||
<span class="sbb-breadcrumb__label"> | ||
<slot> | ||
</slot> | ||
</span> | ||
</a> | ||
`; | ||
/* end snapshot sbb-breadcrumb renders with icon and text */ | ||
|
||
snapshots["sbb-breadcrumb renders as span if no href is provided"] = | ||
`<span class="sbb-breadcrumb"> | ||
<slot name="icon"> | ||
</slot> | ||
<span class="sbb-breadcrumb__label"> | ||
<slot> | ||
</slot> | ||
</span> | ||
</span> | ||
`; | ||
/* end snapshot sbb-breadcrumb renders as span if no href is provided */ | ||
|
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
Oops, something went wrong.