Skip to content

Commit

Permalink
chore(): Typography tests added for BodyM, H2, TextS; _noWrap test up…
Browse files Browse the repository at this point in the history
…dated
  • Loading branch information
denivladislav committed Nov 26, 2024
1 parent 599cfe4 commit e2dd4d7
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,11 +1,74 @@
import React from 'react';
import { mount, CypressTestDecorator, getComponent, PadMe } from '@salutejs/plasma-cy-utils';
import { mount, CypressTestDecorator, getComponent, PadMe, SpaceMe } from '@salutejs/plasma-cy-utils';

describe('plasma-web: Typography', () => {
const DsplS = getComponent('DsplS');
const BodyM = getComponent('BodyM');
const H2 = getComponent('H2');
const TextS = getComponent('TextS');
const Headline5 = getComponent('Headline5');
const Subtitle = getComponent('Subtitle');

it('DsplS', () => {
mount(
<CypressTestDecorator>
<style>{`
body {
font-family: "SB Sans Text", sans-serif;
}
`}</style>
<DsplS>Hello DsplS</DsplS>
</CypressTestDecorator>,
);

cy.matchImageSnapshot();
});

it('BodyM', () => {
mount(
<CypressTestDecorator>
<style>{`
body {
font-family: "SB Sans Text", sans-serif;
}
`}</style>
<BodyM>Hello BodyM</BodyM>
</CypressTestDecorator>,
);

cy.matchImageSnapshot();
});

it('H2', () => {
mount(
<CypressTestDecorator>
<style>{`
body {
font-family: "SB Sans Text", sans-serif;
}
`}</style>
<H2>Hello H2</H2>
</CypressTestDecorator>,
);

cy.matchImageSnapshot();
});

it('TextS', () => {
mount(
<CypressTestDecorator>
<style>{`
body {
font-family: "SB Sans Text", sans-serif;
}
`}</style>
<TextS>Hello TextS</TextS>
</CypressTestDecorator>,
);

cy.matchImageSnapshot();
});

it('Headline5', () => {
mount(
<CypressTestDecorator>
Expand Down Expand Up @@ -66,11 +129,17 @@ describe('plasma-web: Typography', () => {
<div style={{ width: '200px', border: '1px solid red' }}>
<Headline5>Текст на русском языкe, свойство noWrap выключено</Headline5>
<Subtitle>Text in English, noWrap is false</Subtitle>
<SpaceMe />
<H2>Текст на русском языкe, свойство noWrap выключено</H2>
<BodyM>Text in English, noWrap is false</BodyM>
</div>
<PadMe />
<div style={{ width: '200px', border: '1px solid red' }}>
<Headline5 noWrap>Текст на русском языкe, свойство noWrap выключено</Headline5>
<Subtitle noWrap>Text in English, noWrap is false</Subtitle>
<SpaceMe />
<H2 noWrap>Текст на русском языкe, свойство noWrap выключено</H2>
<BodyM noWrap>Text in English, noWrap is false</BodyM>
</div>
</CypressTestDecorator>,
);
Expand Down

0 comments on commit e2dd4d7

Please sign in to comment.