forked from SSENSE/vue-carousel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add jest-serializer-vue as snapshot serializer (SSENSE#341)
- Loading branch information
1 parent
5509f78
commit 5ab768b
Showing
10 changed files
with
451 additions
and
406 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
417 changes: 229 additions & 188 deletions
417
tests/client/components/__snapshots__/carousel.spec.js.snap
Large diffs are not rendered by default.
Oops, something went wrong.
135 changes: 60 additions & 75 deletions
135
tests/client/components/__snapshots__/navigation.spec.js.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 |
---|---|---|
@@ -1,91 +1,76 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Navigation should mount successfully 1`] = ` | ||
".VueCarousel-wrapper | ||
.VueCarousel-inner(style='transform: translate(0px, 0); visibility: hidden; height: auto;') | ||
.VueCarousel-slide(tabindex='-1', role='tabpanel', aria-hidden='true') | ||
.VueCarousel-slide.VueCarousel-slide-active.VueCarousel-slide-center(tabindex='-1', role='tabpanel') | ||
| | ||
.VueCarousel-navigation | ||
button.VueCarousel-navigation-button.VueCarousel-navigation-prev(type='button', aria-label='Previous page', tabindex='0', style='padding: 8px; margin-right: -8px;') ◀ | ||
| | ||
button.VueCarousel-navigation-button.VueCarousel-navigation-next.VueCarousel-navigation--disabled(type='button', aria-label='Next page', tabindex='-1', style='padding: 8px; margin-left: -8px;') ▶ | ||
| | ||
.VueCarousel-pagination(style='') | ||
.VueCarousel-dot-container(role='tablist', style='margin-top: 20px;') | ||
button.VueCarousel-dot(aria-hidden='false', role='tab', title='Item 0', value='Item 0', aria-label='Item 0', aria-selected='false', style='margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(239, 239, 239);') | ||
button.VueCarousel-dot.VueCarousel-dot--active(aria-hidden='false', role='tab', title='Item 1', value='Item 1', aria-label='Item 1', aria-selected='true', style='margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(0, 0, 0);') | ||
" | ||
<section class="VueCarousel"> | ||
<div class="VueCarousel-wrapper"> | ||
<div class="VueCarousel-inner" style="transform: translate(0px, 0); visibility: hidden; height: auto;"> | ||
<div tabindex="-1" role="tabpanel" class="VueCarousel-slide" aria-hidden="true"></div> | ||
<div tabindex="-1" role="tabpanel" class="VueCarousel-slide VueCarousel-slide-active VueCarousel-slide-center"></div> | ||
</div> | ||
</div> | ||
<div class="VueCarousel-navigation"><button type="button" aria-label="Previous page" tabindex="0" class="VueCarousel-navigation-button VueCarousel-navigation-prev" style="padding: 8px; margin-right: -8px;">◀</button> <button type="button" aria-label="Next page" tabindex="-1" class="VueCarousel-navigation-button VueCarousel-navigation-next VueCarousel-navigation--disabled" style="padding: 8px; margin-left: -8px;">▶</button></div> | ||
<div class="VueCarousel-pagination" style=""> | ||
<div role="tablist" class="VueCarousel-dot-container" style="margin-top: 20px;"><button aria-hidden="false" role="tab" title="Item 0" value="Item 0" aria-label="Item 0" aria-selected="false" class="VueCarousel-dot" style="margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(239, 239, 239);"></button><button aria-hidden="false" role="tab" title="Item 1" value="Item 1" aria-label="Item 1" aria-selected="true" class="VueCarousel-dot VueCarousel-dot--active" style="margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(0, 0, 0);"></button></div> | ||
</div> | ||
</section> | ||
`; | ||
|
||
exports[`Navigation should render a next button 1`] = ` | ||
".VueCarousel-wrapper | ||
.VueCarousel-inner(style='transform: translate(0px, 0); visibility: hidden; height: auto;') | ||
.VueCarousel-slide(tabindex='-1', role='tabpanel', aria-hidden='true') | ||
.VueCarousel-slide.VueCarousel-slide-active.VueCarousel-slide-center(tabindex='-1', role='tabpanel') | ||
| | ||
.VueCarousel-navigation | ||
button.VueCarousel-navigation-button.VueCarousel-navigation-prev(type='button', aria-label='Previous page', tabindex='0', style='padding: 8px; margin-right: -8px;') ◀ | ||
| | ||
button.VueCarousel-navigation-button.VueCarousel-navigation-next.VueCarousel-navigation--disabled(type='button', aria-label='Next page', tabindex='-1', style='padding: 8px; margin-left: -8px;') ▶ | ||
| | ||
.VueCarousel-pagination(style='') | ||
.VueCarousel-dot-container(role='tablist', style='margin-top: 20px;') | ||
button.VueCarousel-dot(aria-hidden='false', role='tab', title='Item 0', value='Item 0', aria-label='Item 0', aria-selected='false', style='margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(239, 239, 239);') | ||
button.VueCarousel-dot.VueCarousel-dot--active(aria-hidden='false', role='tab', title='Item 1', value='Item 1', aria-label='Item 1', aria-selected='true', style='margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(0, 0, 0);') | ||
" | ||
<section class="VueCarousel"> | ||
<div class="VueCarousel-wrapper"> | ||
<div class="VueCarousel-inner" style="transform: translate(0px, 0); visibility: hidden; height: auto;"> | ||
<div tabindex="-1" role="tabpanel" class="VueCarousel-slide" aria-hidden="true"></div> | ||
<div tabindex="-1" role="tabpanel" class="VueCarousel-slide VueCarousel-slide-active VueCarousel-slide-center"></div> | ||
</div> | ||
</div> | ||
<div class="VueCarousel-navigation"><button type="button" aria-label="Previous page" tabindex="0" class="VueCarousel-navigation-button VueCarousel-navigation-prev" style="padding: 8px; margin-right: -8px;">◀</button> <button type="button" aria-label="Next page" tabindex="-1" class="VueCarousel-navigation-button VueCarousel-navigation-next VueCarousel-navigation--disabled" style="padding: 8px; margin-left: -8px;">▶</button></div> | ||
<div class="VueCarousel-pagination" style=""> | ||
<div role="tablist" class="VueCarousel-dot-container" style="margin-top: 20px;"><button aria-hidden="false" role="tab" title="Item 0" value="Item 0" aria-label="Item 0" aria-selected="false" class="VueCarousel-dot" style="margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(239, 239, 239);"></button><button aria-hidden="false" role="tab" title="Item 1" value="Item 1" aria-label="Item 1" aria-selected="true" class="VueCarousel-dot VueCarousel-dot--active" style="margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(0, 0, 0);"></button></div> | ||
</div> | ||
</section> | ||
`; | ||
|
||
exports[`Navigation should render a prev button 1`] = ` | ||
".VueCarousel-wrapper | ||
.VueCarousel-inner(style='transform: translate(0px, 0); visibility: hidden; height: auto;') | ||
.VueCarousel-slide(tabindex='-1', role='tabpanel', aria-hidden='true') | ||
.VueCarousel-slide.VueCarousel-slide-active.VueCarousel-slide-center(tabindex='-1', role='tabpanel') | ||
| | ||
.VueCarousel-navigation | ||
button.VueCarousel-navigation-button.VueCarousel-navigation-prev(type='button', aria-label='Previous page', tabindex='0', style='padding: 8px; margin-right: -8px;') ◀ | ||
| | ||
button.VueCarousel-navigation-button.VueCarousel-navigation-next.VueCarousel-navigation--disabled(type='button', aria-label='Next page', tabindex='-1', style='padding: 8px; margin-left: -8px;') ▶ | ||
| | ||
.VueCarousel-pagination(style='') | ||
.VueCarousel-dot-container(role='tablist', style='margin-top: 20px;') | ||
button.VueCarousel-dot(aria-hidden='false', role='tab', title='Item 0', value='Item 0', aria-label='Item 0', aria-selected='false', style='margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(239, 239, 239);') | ||
button.VueCarousel-dot.VueCarousel-dot--active(aria-hidden='false', role='tab', title='Item 1', value='Item 1', aria-label='Item 1', aria-selected='true', style='margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(0, 0, 0);') | ||
" | ||
<section class="VueCarousel"> | ||
<div class="VueCarousel-wrapper"> | ||
<div class="VueCarousel-inner" style="transform: translate(0px, 0); visibility: hidden; height: auto;"> | ||
<div tabindex="-1" role="tabpanel" class="VueCarousel-slide" aria-hidden="true"></div> | ||
<div tabindex="-1" role="tabpanel" class="VueCarousel-slide VueCarousel-slide-active VueCarousel-slide-center"></div> | ||
</div> | ||
</div> | ||
<div class="VueCarousel-navigation"><button type="button" aria-label="Previous page" tabindex="0" class="VueCarousel-navigation-button VueCarousel-navigation-prev" style="padding: 8px; margin-right: -8px;">◀</button> <button type="button" aria-label="Next page" tabindex="-1" class="VueCarousel-navigation-button VueCarousel-navigation-next VueCarousel-navigation--disabled" style="padding: 8px; margin-left: -8px;">▶</button></div> | ||
<div class="VueCarousel-pagination" style=""> | ||
<div role="tablist" class="VueCarousel-dot-container" style="margin-top: 20px;"><button aria-hidden="false" role="tab" title="Item 0" value="Item 0" aria-label="Item 0" aria-selected="false" class="VueCarousel-dot" style="margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(239, 239, 239);"></button><button aria-hidden="false" role="tab" title="Item 1" value="Item 1" aria-label="Item 1" aria-selected="true" class="VueCarousel-dot VueCarousel-dot--active" style="margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(0, 0, 0);"></button></div> | ||
</div> | ||
</section> | ||
`; | ||
|
||
exports[`Navigation should trigger page advance backward when prev is clicked 1`] = ` | ||
".VueCarousel-wrapper | ||
.VueCarousel-inner(style='transform: translate(0px, 0); visibility: hidden; height: auto;') | ||
.VueCarousel-slide(tabindex='-1', role='tabpanel', aria-hidden='true') | ||
.VueCarousel-slide.VueCarousel-slide-active.VueCarousel-slide-center(tabindex='-1', role='tabpanel') | ||
| | ||
.VueCarousel-navigation | ||
button.VueCarousel-navigation-button.VueCarousel-navigation-prev(type='button', aria-label='Previous page', tabindex='0', style='padding: 8px; margin-right: -8px;') ◀ | ||
| | ||
button.VueCarousel-navigation-button.VueCarousel-navigation-next.VueCarousel-navigation--disabled(type='button', aria-label='Next page', tabindex='-1', style='padding: 8px; margin-left: -8px;') ▶ | ||
| | ||
.VueCarousel-pagination(style='') | ||
.VueCarousel-dot-container(role='tablist', style='margin-top: 20px;') | ||
button.VueCarousel-dot(aria-hidden='false', role='tab', title='Item 0', value='Item 0', aria-label='Item 0', aria-selected='false', style='margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(239, 239, 239);') | ||
button.VueCarousel-dot.VueCarousel-dot--active(aria-hidden='false', role='tab', title='Item 1', value='Item 1', aria-label='Item 1', aria-selected='true', style='margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(0, 0, 0);') | ||
" | ||
<section class="VueCarousel"> | ||
<div class="VueCarousel-wrapper"> | ||
<div class="VueCarousel-inner" style="transform: translate(0px, 0); visibility: hidden; height: auto;"> | ||
<div tabindex="-1" role="tabpanel" class="VueCarousel-slide" aria-hidden="true"></div> | ||
<div tabindex="-1" role="tabpanel" class="VueCarousel-slide VueCarousel-slide-active VueCarousel-slide-center"></div> | ||
</div> | ||
</div> | ||
<div class="VueCarousel-navigation"><button type="button" aria-label="Previous page" tabindex="0" class="VueCarousel-navigation-button VueCarousel-navigation-prev" style="padding: 8px; margin-right: -8px;">◀</button> <button type="button" aria-label="Next page" tabindex="-1" class="VueCarousel-navigation-button VueCarousel-navigation-next VueCarousel-navigation--disabled" style="padding: 8px; margin-left: -8px;">▶</button></div> | ||
<div class="VueCarousel-pagination" style=""> | ||
<div role="tablist" class="VueCarousel-dot-container" style="margin-top: 20px;"><button aria-hidden="false" role="tab" title="Item 0" value="Item 0" aria-label="Item 0" aria-selected="false" class="VueCarousel-dot" style="margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(239, 239, 239);"></button><button aria-hidden="false" role="tab" title="Item 1" value="Item 1" aria-label="Item 1" aria-selected="true" class="VueCarousel-dot VueCarousel-dot--active" style="margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(0, 0, 0);"></button></div> | ||
</div> | ||
</section> | ||
`; | ||
|
||
exports[`Navigation should trigger page advance when next is clicked 1`] = ` | ||
".VueCarousel-wrapper | ||
.VueCarousel-inner(style='transform: translate(0px, 0); visibility: hidden; height: auto;') | ||
.VueCarousel-slide(tabindex='-1', role='tabpanel', aria-hidden='true') | ||
.VueCarousel-slide.VueCarousel-slide-active.VueCarousel-slide-center(tabindex='-1', role='tabpanel') | ||
| | ||
.VueCarousel-navigation | ||
button.VueCarousel-navigation-button.VueCarousel-navigation-prev(type='button', aria-label='Previous page', tabindex='0', style='padding: 8px; margin-right: -8px;') ◀ | ||
| | ||
button.VueCarousel-navigation-button.VueCarousel-navigation-next.VueCarousel-navigation--disabled(type='button', aria-label='Next page', tabindex='-1', style='padding: 8px; margin-left: -8px;') ▶ | ||
| | ||
.VueCarousel-pagination(style='') | ||
.VueCarousel-dot-container(role='tablist', style='margin-top: 20px;') | ||
button.VueCarousel-dot(aria-hidden='false', role='tab', title='Item 0', value='Item 0', aria-label='Item 0', aria-selected='false', style='margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(239, 239, 239);') | ||
button.VueCarousel-dot.VueCarousel-dot--active(aria-hidden='false', role='tab', title='Item 1', value='Item 1', aria-label='Item 1', aria-selected='true', style='margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(0, 0, 0);') | ||
" | ||
<section class="VueCarousel"> | ||
<div class="VueCarousel-wrapper"> | ||
<div class="VueCarousel-inner" style="transform: translate(0px, 0); visibility: hidden; height: auto;"> | ||
<div tabindex="-1" role="tabpanel" class="VueCarousel-slide" aria-hidden="true"></div> | ||
<div tabindex="-1" role="tabpanel" class="VueCarousel-slide VueCarousel-slide-active VueCarousel-slide-center"></div> | ||
</div> | ||
</div> | ||
<div class="VueCarousel-navigation"><button type="button" aria-label="Previous page" tabindex="0" class="VueCarousel-navigation-button VueCarousel-navigation-prev" style="padding: 8px; margin-right: -8px;">◀</button> <button type="button" aria-label="Next page" tabindex="-1" class="VueCarousel-navigation-button VueCarousel-navigation-next VueCarousel-navigation--disabled" style="padding: 8px; margin-left: -8px;">▶</button></div> | ||
<div class="VueCarousel-pagination" style=""> | ||
<div role="tablist" class="VueCarousel-dot-container" style="margin-top: 20px;"><button aria-hidden="false" role="tab" title="Item 0" value="Item 0" aria-label="Item 0" aria-selected="false" class="VueCarousel-dot" style="margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(239, 239, 239);"></button><button aria-hidden="false" role="tab" title="Item 1" value="Item 1" aria-label="Item 1" aria-selected="true" class="VueCarousel-dot VueCarousel-dot--active" style="margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(0, 0, 0);"></button></div> | ||
</div> | ||
</section> | ||
`; |
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,12 +1,15 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Slide should mount successfully 1`] = ` | ||
".VueCarousel-wrapper | ||
.VueCarousel-inner(style='transform: translate(0px, 0); visibility: hidden; height: auto;') | ||
.VueCarousel-slide(tabindex='-1', aria-hidden='true', role='tabpanel') | ||
// | ||
.VueCarousel-pagination(style='display: none;') | ||
.VueCarousel-dot-container(role='tablist', style='margin-top: 20px;') | ||
button.VueCarousel-dot.VueCarousel-dot--active(aria-hidden='false', role='tab', title='Item 0', value='Item 0', aria-label='Item 0', aria-selected='true', style='margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(0, 0, 0);') | ||
" | ||
<section class="VueCarousel"> | ||
<div class="VueCarousel-wrapper"> | ||
<div class="VueCarousel-inner" style="transform: translate(0px, 0); visibility: hidden; height: auto;"> | ||
<div tabindex="-1" aria-hidden="true" role="tabpanel" class="VueCarousel-slide"></div> | ||
</div> | ||
</div> | ||
<!----> | ||
<div class="VueCarousel-pagination" style="display: none;"> | ||
<div role="tablist" class="VueCarousel-dot-container" style="margin-top: 20px;"><button aria-hidden="false" role="tab" title="Item 0" value="Item 0" aria-label="Item 0" aria-selected="true" class="VueCarousel-dot VueCarousel-dot--active" style="margin-top: 20px; padding: 10px; width: 10px; height: 10px; background-color: rgb(0, 0, 0);"></button></div> | ||
</div> | ||
</section> | ||
`; |
Oops, something went wrong.