-
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.
#237 - Creating carousel cards tests
- Loading branch information
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
src/components/CarouselCards/__test__/__snapshots__/index.test.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Render Carousel Item 1`] = `ReactWrapper {}`; | ||
|
||
exports[`Render Carousel With Data 1`] = `ReactWrapper {}`; | ||
|
||
exports[`snapshot should not have changes 1`] = `ShallowWrapper {}`; |
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import React from 'react'; | ||
import { shallow, mount } from 'enzyme'; | ||
import CaroulselCards from '../index'; | ||
import TotalFrame from '../../Frames/TotalFrame'; | ||
import MockTheme from '../../../mocks/theme/mockTheme'; | ||
import * as TEXTCONSTANTS from '../../../settings/texts/AudienciasPage'; | ||
|
||
const carouselItens = [ | ||
{ | ||
isLoaded: true, | ||
info: 10, | ||
title: TEXTCONSTANTS.audiencesTotalsTexts.subSectionParticipantsTotals.title, | ||
toolTipText: TEXTCONSTANTS.audiencesTotalsTexts.subSectionParticipantsTotals.toolTip, | ||
toolTipAriaLabel: TEXTCONSTANTS.audiencesTotalsTexts.subSectionParticipantsTotals | ||
.toolTipAriaLabel, | ||
toolTipColor: '#FFFF', | ||
}, | ||
{ | ||
isLoaded: true, | ||
info: 10, | ||
title: TEXTCONSTANTS.audiencesTotalsTexts.subSectionAudiencesTotals.title, | ||
toolTipText: TEXTCONSTANTS.audiencesTotalsTexts.subSectionAudiencesTotals.toolTip, | ||
toolTipAriaLabel: TEXTCONSTANTS.audiencesTotalsTexts.subSectionAudiencesTotals.toolTipAriaLabel, | ||
oolTipColor: '#FFFF', | ||
subInformation: '2 realizadas', | ||
}, | ||
{ | ||
isLoaded: true, | ||
info: 10, | ||
title: TEXTCONSTANTS.audiencesTotalsTexts.subSectionMessagesTotals.title, | ||
toolTipText: TEXTCONSTANTS.audiencesTotalsTexts.subSectionMessagesTotals.toolTip, | ||
toolTipAriaLabel: TEXTCONSTANTS.audiencesTotalsTexts.subSectionMessagesTotals.toolTipAriaLabel, | ||
toolTipColor: '#FFFF', | ||
}, | ||
{ | ||
isLoaded: true, | ||
info: 10, | ||
title: TEXTCONSTANTS.audiencesTotalsTexts.subSectionQuestionsTotals.title, | ||
toolTipText: TEXTCONSTANTS.audiencesTotalsTexts.subSectionQuestionsTotals.toolTip, | ||
toolTipAriaLabel: TEXTCONSTANTS.audiencesTotalsTexts.subSectionQuestionsTotals.toolTipAriaLabel, | ||
}, | ||
]; | ||
|
||
it('snapshot should not have changes', () => { | ||
const component = shallow(<MockTheme><CaroulselCards carouselItens={[]} /></MockTheme>); | ||
expect(component.exists()).toEqual(true); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
|
||
it('Render Carousel With Data', () => { | ||
const component = mount(<MockTheme><CaroulselCards carouselItens={carouselItens} /></MockTheme>); | ||
expect(component.exists()).toEqual(true); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
|
||
// Test Caroulsel Item | ||
it('Render Carousel Item', () => { | ||
const component = mount(<MockTheme><TotalFrame item={carouselItens[0]} /></MockTheme>); | ||
expect(component.exists()).toEqual(true); | ||
expect(component).toMatchSnapshot(); | ||
}); |