Skip to content

Commit

Permalink
TP-1283-update-carousel
Browse files Browse the repository at this point in the history
  • Loading branch information
aguescribano87 committed May 2, 2024
1 parent 24de9b6 commit 653ba04
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -345,4 +345,4 @@



window['STORIES'] = [];</script><script src="runtime~main.087d072d.iframe.bundle.js"></script><script src="vendors~main.bed38707.iframe.bundle.js"></script><script src="main.be5559d7.iframe.bundle.js"></script></body></html>
window['STORIES'] = [];</script><script src="runtime~main.087d072d.iframe.bundle.js"></script><script src="vendors~main.bed38707.iframe.bundle.js"></script><script src="main.ea73c1e1.iframe.bundle.js"></script></body></html>
3 changes: 0 additions & 3 deletions docs/main.be5559d7.iframe.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/main.be5559d7.iframe.bundle.js.map

This file was deleted.

3 changes: 3 additions & 0 deletions docs/main.ea73c1e1.iframe.bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/main.ea73c1e1.iframe.bundle.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 30 additions & 8 deletions packages/carousel/test/Gallery.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import React from 'react'
import { configure, mount } from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'
import { Carousel } from '../src'
import { Box } from '@oneloop/box'

configure({ adapter: new Adapter() })

Expand All @@ -14,15 +13,18 @@ describe('Carousel', () => {
})

it('renders correct number of tabs', () => {
const wrapper = mount(
<div style={{ minWidth: '1500px' }}>
<Carousel images={['', '']} />
</div>
)
const wrapper = mount(<Carousel images={['', '']} />)
const btn = wrapper.find('.buttonGallery')
console.log(wrapper.debug())

expect(btn.at(0).text()).toBe('Fotos')
expect(btn).toBeDefined()
})

it('next or prev img mobile', () => {
const wrapper = mount(<Carousel images={['1', '2']} />)

const btnNext = wrapper.find('.iconNextMobile').first()

btnNext.simulate('click')
})

it('toggles fullscreen correctly', () => {
Expand All @@ -32,6 +34,8 @@ describe('Carousel', () => {
video={['', '']}
video360={['', '']}
planos={['', '']}
frontCoverImg={['img']}
frontCoverBlueprints={['img']}
/>
)
const fullscreenButton = wrapper.find('.firstTabImg').at(0)
Expand All @@ -41,6 +45,24 @@ describe('Carousel', () => {
const tab = wrapper.find('.fsTabHeader')

expect(tab.at(0).text()).toBe('VideosVideo360FotosPlanos')

const videosNode = wrapper
.findWhere((node) => node.text() === 'Videos')
.at(0)

videosNode.simulate('click')

const panosNode = wrapper
.findWhere((node) => node.text() === 'Planos')
.at(0)

panosNode.simulate('click')

const Video360 = wrapper
.findWhere((node) => node.text() === 'Video360')
.at(0)

Video360.simulate('click')
})

it('change img', () => {
Expand Down

0 comments on commit 653ba04

Please sign in to comment.