feat(carousel): support w3c WAI-ARIA pattern #597
Annotations
2 errors
src/components/carousel/tests/carousel.test.ts > OCarousel tests > render correctly:
packages/oruga/src/components/carousel/tests/carousel.test.ts#L14
Error: Snapshot `OCarousel tests > render correctly 1` mismatched
- Expected
+ Received
- "<div class="o-car" data-oruga="carousel" role="region">
+ "<section class="o-car" data-oruga="carousel" role="region" aria-roledescription="carousel">
<div class="o-car__wrapper">
- <div class="o-car__items" style="transform: translateX(0px);" tabindex="0" role="group" draggable="true" aria-roledescription="carousel">
+ <!--
+ @slot Override the pause/resume button
+ @binding {boolean} autoplay if autoplay is active
- <!--
- @slot Display carousel item
- -->
+ @binding {(): void} toggle toggle autoplay
+ -->
- </div>
+ <!--v-if-->
<!--
@slot Override the arrows
@binding {boolean} has-prev has prev arrow button
@binding {boolean} has-next has next arrow button
@binding {(): void} prev switch to prev item function
@binding {(): void} next switch to next item function
- --><span class="o-icon o-car__arrow__icon o-car__arrow__icon-prev" data-oruga="icon" role="button" tabindex="0" style="display: none;"><!-- custom icon component --><!-- native css icon --><i class="mdi mdi-chevron-left mdi-24px"></i></span><span class="o-icon o-car__arrow__icon o-car__arrow__icon-next" data-oruga="icon" role="button" tabindex="0" style="display: none;"><!-- custom icon component --><!-- native css icon --><i class="mdi mdi-chevron-right mdi-24px"></i></span>
+ --><span class="o-icon o-car__arrow__icon o-car__arrow__icon-prev" data-oruga="icon" role="button" tabindex="0" aria-label="Previous Slide" style="display: none;"><!-- custom icon component --><!-- native css icon --><i class="mdi mdi-chevron-left mdi-24px"></i></span><span class="o-icon o-car__arrow__icon o-car__arrow__icon-next" data-oruga="icon" role="button" tabindex="0" aria-label="Next Slide" style="display: none;"><!-- custom icon component --><!-- native css icon --><i class="mdi mdi-chevron-right mdi-24px"></i></span>
+ <div class="o-car__items" style="transform: translateX(0px);" aria-roledescription="carousel-slide" aria-atomic="false" aria-live="polite">
+ <!--
+ @slot Display carousel item
+ -->
+ </div>
</div>
<!--
@slot Override the indicators
@binding {number} active active index
@binding {(idx: number): void} switch-to switch to item function
- @binding {number} indicator-index current indicator index
- -->
- <!--v-if-->
+ -->
+ <div class="o-car__indicators" role="tablist" aria-label="Slides"></div>
<!--v-if-->
- </div>"
+ </section>"
❯ src/components/carousel/tests/carousel.test.ts:14:32
|
test
Process completed with exit code 1.
|