Skip to content

0.13.0

0.13.0 #164

GitHub Actions / Tests results succeeded Jan 15, 2025 in 1s

91 passed, 0 failed and 0 skipped

Tests passed successfully

✅ junit-report.xml

91 tests were completed in 7s with 91 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
src/components/Carousel/Carousel.spec.ts 1✅ 30ms
src/components/Icon/Icon.spec.ts 3✅ 71ms
src/utils/calculateAverage.spec.ts 5✅ 4ms
src/utils/camelCaseToKebabCase.spec.ts 6✅ 5ms
src/utils/createCloneSlides.spec.ts 6✅ 7ms
src/utils/disableChildrenTabbing.spec.ts 3✅ 29ms
src/utils/except.spec.ts 1✅ 7ms
src/utils/getDraggedSlidesCount.spec.ts 5✅ 5ms
src/utils/getNumberInRange.spec.ts 5✅ 4ms
src/utils/getScaleMultiplier.spec.ts 1✅ 8ms
src/utils/getSnapAlignOffset.spec.ts 11✅ 7ms
src/utils/i18nFormatter.spec.ts 5✅ 4ms
src/utils/mapNumberToRange.spec.ts 6✅ 4ms
src/utils/throttle.spec.ts 1✅ 10ms
src/utils/toCssValue.spec.ts 4✅ 5ms
tests/integration/aria.spec.ts 2✅ 39ms
tests/integration/carousel.spec.ts 20✅ 484ms
tests/integration/navigation.spec.ts 4✅ 109ms
tests/integration/pagination.spec.ts 2✅ 75ms

✅ src/components/Carousel/Carousel.spec.ts

src/components/Carousel/Carousel.spec.ts
  ✅ Carousel.ts > It renders correctly

✅ src/components/Icon/Icon.spec.ts

src/components/Icon/Icon.spec.ts
  ✅ Icon.ts > It should error if iconName is invalid
  ✅ Icon.ts > It should error if no iconName
  ✅ Icon.ts > It should render standalone

✅ src/utils/calculateAverage.spec.ts

src/utils/calculateAverage.spec.ts
  ✅ calculateAverage > calculates average for multiple values
  ✅ calculateAverage > calculates average for single value
  ✅ calculateAverage > handles decimal numbers
  ✅ calculateAverage > handles negative numbers
  ✅ calculateAverage > returns 0 for empty array

✅ src/utils/camelCaseToKebabCase.spec.ts

src/utils/camelCaseToKebabCase.spec.ts
  ✅ camelCaseToKebabCase > converts multiple camelCase words to kebab-case
  ✅ camelCaseToKebabCase > converts single camelCase word to kebab-case
  ✅ camelCaseToKebabCase > handles empty strings
  ✅ camelCaseToKebabCase > handles strings with no uppercase letters
  ✅ camelCaseToKebabCase > handles strings with numbers
  ✅ camelCaseToKebabCase > handles strings with special characters

✅ src/utils/createCloneSlides.spec.ts

src/utils/createCloneSlides.spec.ts
  ✅ createCloneSlides > should clone slides correctly after
  ✅ createCloneSlides > should clone slides correctly before
  ✅ createCloneSlides > should create the correct number of clones after
  ✅ createCloneSlides > should create the correct number of clones before
  ✅ createCloneSlides > should handle empty slides array
  ✅ createCloneSlides > should handle zero clones

✅ src/utils/disableChildrenTabbing.spec.ts

src/utils/disableChildrenTabbing.spec.ts
  ✅ disableChildrenTabbing > should disable tabbing for all child elements
  ✅ disableChildrenTabbing > should not affect elements outside the container
  ✅ disableChildrenTabbing > should not change tabIndex for elements that already have tabIndex -1

✅ src/utils/except.spec.ts

src/utils/except.spec.ts
  ✅ except > should return an object without keys

✅ src/utils/getDraggedSlidesCount.spec.ts

src/utils/getDraggedSlidesCount.spec.ts
  ✅ getDraggedSlidesCount > should calculate the correct number of slides for horizontal drag
  ✅ getDraggedSlidesCount > should calculate the correct number of slides for reversed horizontal drag
  ✅ getDraggedSlidesCount > should calculate the correct number of slides for reversed vertical drag
  ✅ getDraggedSlidesCount > should calculate the correct number of slides for vertical drag
  ✅ getDraggedSlidesCount > should handle zero drag

✅ src/utils/getNumberInRange.spec.ts

src/utils/getNumberInRange.spec.ts
  ✅ getCurrentSlideIndex > When min is larger than max should return val
  ✅ getCurrentSlideIndex > When the number inside the range should return the same value
  ✅ getCurrentSlideIndex > When the number is larger than the range should return the max value
  ✅ getCurrentSlideIndex > When the number is smaller than the range should return the min value
  ✅ getCurrentSlideIndex > doesn`t bound a NaN min or max

✅ src/utils/getScaleMultiplier.spec.ts

src/utils/getScaleMultiplier.spec.ts
  ✅ getWidthMultiplier.ts > gets the transform matrix of an element

✅ src/utils/getSnapAlignOffset.spec.ts

src/utils/getSnapAlignOffset.spec.ts
  ✅ getSnapAlignOffset > edge cases > should handle equal viewport and slide sizes
  ✅ getSnapAlignOffset > edge cases > should return 0 for invalid alignment
  ✅ getSnapAlignOffset > edge cases > should return 0 when no parameters provided
  ✅ getSnapAlignOffset > with itemsToShow parameter > should return correct offset for center/center-odd alignment
  ✅ getSnapAlignOffset > with itemsToShow parameter > should return correct offset for center-even alignment
  ✅ getSnapAlignOffset > with itemsToShow parameter > should return correct offset for end alignment
  ✅ getSnapAlignOffset > with itemsToShow parameter > should return correct offset for start alignment
  ✅ getSnapAlignOffset > with slideSize and viewportSize parameters > should return correct offset for center/center-odd alignment
  ✅ getSnapAlignOffset > with slideSize and viewportSize parameters > should return correct offset for center-even alignment
  ✅ getSnapAlignOffset > with slideSize and viewportSize parameters > should return correct offset for end alignment
  ✅ getSnapAlignOffset > with slideSize and viewportSize parameters > should return correct offset for start alignment

✅ src/utils/i18nFormatter.spec.ts

src/utils/i18nFormatter.spec.ts
  ✅ i18nFormatter > handles empty string input
  ✅ i18nFormatter > handles no values input
  ✅ i18nFormatter > leaves placeholders without corresponding values unchanged
  ✅ i18nFormatter > replaces multiple placeholders
  ✅ i18nFormatter > replaces placeholders with corresponding values

✅ src/utils/mapNumberToRange.spec.ts

src/utils/mapNumberToRange.spec.ts
  ✅ getCurrentSlideIndex > Keeps float values less than 1 over max
  ✅ getCurrentSlideIndex > When min is non zero should return correctly mapped value
  ✅ getCurrentSlideIndex > When the number inside the range should return the same value
  ✅ getCurrentSlideIndex > When the number is larger than the range should return correctly mapped value
  ✅ getCurrentSlideIndex > When the number is smaller than the range should return correctly mapped value
  ✅ getCurrentSlideIndex > Wraps float values more than 1 over max

✅ src/utils/throttle.spec.ts

src/utils/throttle.spec.ts
  ✅ throttle > should call the function again after the wait time

✅ src/utils/toCssValue.spec.ts

src/utils/toCssValue.spec.ts
  ✅ toCssValue > should convert number to px string
  ✅ toCssValue > should handle empty string correctly
  ✅ toCssValue > should handle zero correctly
  ✅ toCssValue > should return string as is

✅ tests/integration/aria.spec.ts

tests/integration/aria.spec.ts
  ✅ Aria.ts > renders properly with a carousel
  ✅ Aria.ts > doesn't render without a carousel

✅ tests/integration/carousel.spec.ts

tests/integration/carousel.spec.ts
  ✅ Carousel.ts > It renders *five* slides correctly
  ✅ Carousel.ts > Should display *one* visible item
  ✅ Carousel.ts > Should display *one* next item
  ✅ Carousel.ts > Should navigate to the focused slide
  ✅ Carousel.ts > Should navigate the carousel with arrow keys
  ✅ Carousel.ts > Should default itemsToShow to 1 if less than 1
  ✅ Carousel.ts > Should default itemsToShow to slidesCount if greater than slidesCount
  ✅ Slotted Carousel.ts > It renders *three* slides correctly
  ✅ Slotted Carousel.ts > Should display *one* visible item
  ✅ Slotted Carousel.ts > Should display *one* next item
  ✅ Wrap around Carousel.ts > renders wrapAround correctly
  ✅ SSR Carousel > renders server side properly
  ✅ SSR Carousel > renders slotted server side properly
  ✅ SSR Carousel > doesn't get hydration mismatch with breakpoints
  ✅ Carousel Clone Count Logic > should not clone slides when wrapAround is disabled
  ✅ Carousel Clone Count Logic > should calculate correct clone counts at start position
  ✅ Carousel Clone Count Logic > should adjust clone counts when scrolling to middle
  ✅ Carousel Clone Count Logic > should handle edge case at last slide
  ✅ Carousel Clone Count Logic > should handle decimal itemsToShow with itemsToScroll
  ✅ Carousel Clone Count Logic > should handle minimal setup with a single item

✅ tests/integration/navigation.spec.ts

tests/integration/navigation.spec.ts
  ✅ Navigation.ts > renders properly with a carousel
  ✅ Navigation.ts > doesn't render without a carousel
  ✅ Navigation.ts > inherits attrs on buttons
  ✅ Navigation.ts > renders custom icons

✅ tests/integration/pagination.spec.ts

tests/integration/pagination.spec.ts
  ✅ Navigation.ts > renders properly with a carousel
  ✅ Navigation.ts > doesn't render without a carousel