carousel.spec.ts 683 B

12345678910111213141516171819202122232425262728
  1. import { expect, it, describe, beforeAll } from 'vitest'
  2. import { mount } from '@vue/test-utils'
  3. import App from './App'
  4. describe('Carousel.ts', () => {
  5. let wrapper: any
  6. beforeAll(async () => {
  7. wrapper = mount(App)
  8. })
  9. it('It renders *five* slides correctly', () => {
  10. const slides = wrapper.findAll('.carousel__slide')
  11. expect(slides.length).toBe(5)
  12. })
  13. it('Should display *one* visible item', () => {
  14. const slides = wrapper.findAll('.carousel__slide--visible')
  15. expect(slides.length).toBe(1)
  16. })
  17. it('Should display *one* next item', () => {
  18. const slides = wrapper.findAll('.carousel__slide--next')
  19. expect(slides.length).toBe(1)
  20. })
  21. })