Skip to content

Commit

Permalink
feat(plasma-b2c/web): add test for predefined Segments
Browse files Browse the repository at this point in the history
  • Loading branch information
TitanKuzmich committed Jun 25, 2024
1 parent accb995 commit 143d04a
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,22 @@ describe('plasma-web: Segment', () => {
cy.matchImageSnapshot();
});

it('single choice predefined', () => {
mount(
<CypressTestDecorator>
<SegmentProvider>
<SegmentGroup defaultSelected={['segment_1']} view="filled" filledBackground>
<SegmentItem value="segment_1" label="Segment 1" view="default" />
<SegmentItem value="segment_2" label="Segment 2" view="default" />
<SegmentItem value="segment_3" label="Segment 3" view="default" />
</SegmentGroup>
</SegmentProvider>
</CypressTestDecorator>,
);

cy.matchImageSnapshot();
});

it('multiple choice', () => {
mount(
<CypressTestDecorator>
Expand All @@ -246,6 +262,27 @@ describe('plasma-web: Segment', () => {
cy.matchImageSnapshot();
});

it('multiple choice predefined', () => {
mount(
<CypressTestDecorator>
<SegmentProvider>
<SegmentGroup
defaultSelected={['segment_1', 'segment_2']}
selectionMode="multiple"
view="filled"
filledBackground
>
<SegmentItem value="segment_1" label="Segment 1" view="default" />
<SegmentItem value="segment_2" label="Segment 2" view="default" />
<SegmentItem value="segment_3" label="Segment 3" view="default" />
</SegmentGroup>
</SegmentProvider>
</CypressTestDecorator>,
);

cy.matchImageSnapshot();
});

it('navigate with arrow`', () => {
mount(
<CypressTestDecorator>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,22 @@ describe('plasma-web: Segment', () => {
cy.matchImageSnapshot();
});

it('single choice predefined', () => {
mount(
<CypressTestDecoratorWithTypo>
<SegmentProvider>
<SegmentGroup defaultSelected={['segment_1']} view="filled" filledBackground>
<SegmentItem value="segment_1" label="Segment 1" view="default" />
<SegmentItem value="segment_2" label="Segment 2" view="default" />
<SegmentItem value="segment_3" label="Segment 3" view="default" />
</SegmentGroup>
</SegmentProvider>
</CypressTestDecoratorWithTypo>,
);

cy.matchImageSnapshot();
});

it('multiple choice', () => {
mount(
<CypressTestDecoratorWithTypo>
Expand All @@ -258,6 +274,27 @@ describe('plasma-web: Segment', () => {
cy.matchImageSnapshot();
});

it('multiple choice predefined', () => {
mount(
<CypressTestDecoratorWithTypo>
<SegmentProvider>
<SegmentGroup
defaultSelected={['segment_1', 'segment_2']}
selectionMode="multiple"
view="filled"
filledBackground
>
<SegmentItem value="segment_1" label="Segment 1" view="default" />
<SegmentItem value="segment_2" label="Segment 2" view="default" />
<SegmentItem value="segment_3" label="Segment 3" view="default" />
</SegmentGroup>
</SegmentProvider>
</CypressTestDecoratorWithTypo>,
);

cy.matchImageSnapshot();
});

it('navigate with arrow`', () => {
mount(
<CypressTestDecoratorWithTypo>
Expand Down

0 comments on commit 143d04a

Please sign in to comment.