Skip to content

Commit

Permalink
chore(plasma-{b2c, web}): tests and shapshots updated
Browse files Browse the repository at this point in the history
  • Loading branch information
denivladislav committed Dec 19, 2024
1 parent 40741dd commit e1d27be
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 0 deletions.
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
Expand Up @@ -12,6 +12,7 @@ const inputSelector = 'input';

const sizes = ['xs', 's', 'm', 'l'];
const views = ['default', 'accent', 'secondary', 'success', 'warning', 'critical', 'clear'];
const helperTextViews = ['default', 'negative'];
const buttonTypes = ['button', 'iconButton'];
const flows = ['horizontal', 'vertical', 'auto'];
const filenameTruncationWidths = ['400px', '350px', '300px', '180px', '0px'];
Expand Down Expand Up @@ -67,6 +68,25 @@ describe('plasma-b2c: Attach', () => {
cy.matchImageSnapshot();
});

it('_helperTextView', () => {
mount(
<CypressTestDecoratorWithTypo>
{helperTextViews.map((helperTextView) => (
<>
<Attach helperTextView={helperTextView} helperText="helperText" />
<PadMe />
<PadMe />
<PadMe />
</>
))}
</CypressTestDecoratorWithTypo>,
);
cy.get(inputSelector).each(($element) => cy.wrap($element).attachFile(FIXTURE_PATH));
cy.get(cellRootSelector).should('have.length', helperTextViews.length);

cy.matchImageSnapshot();
});

it('_hasAttachment=false', () => {
mount(
<CypressTestDecoratorWithTypo>
Expand Down Expand Up @@ -113,6 +133,25 @@ describe('plasma-b2c: Attach', () => {
cy.matchImageSnapshot();
});

it('_flow with helperText', () => {
mount(
<CypressTestDecoratorWithTypo>
{flows.map((flow) => (
<>
<Attach flow={flow} helperText="helperText" />
<PadMe />
<PadMe />
<PadMe />
</>
))}
</CypressTestDecoratorWithTypo>,
);
cy.get(inputSelector).each(($element) => cy.wrap($element).attachFile(FIXTURE_PATH));
cy.get(cellRootSelector).should('have.length', flows.length);

cy.matchImageSnapshot();
});

it('filenameTruncation flow:auto', () => {
mount(
<CypressTestDecoratorWithTypo>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const inputSelector = 'input';

const sizes = ['xs', 's', 'm', 'l'];
const views = ['default', 'accent', 'secondary', 'success', 'warning', 'critical', 'clear'];
const helperTextViews = ['default', 'negative'];
const buttonTypes = ['button', 'iconButton'];
const flows = ['horizontal', 'vertical', 'auto'];
const filenameTruncationWidths = ['400px', '350px', '300px', '180px', '0px'];
Expand Down Expand Up @@ -67,6 +68,25 @@ describe('plasma-web: Attach', () => {
cy.matchImageSnapshot();
});

it('_helperTextView', () => {
mount(
<CypressTestDecoratorWithTypo>
{helperTextViews.map((helperTextView) => (
<>
<Attach helperTextView={helperTextView} helperText="helperText" />
<PadMe />
<PadMe />
<PadMe />
</>
))}
</CypressTestDecoratorWithTypo>,
);
cy.get(inputSelector).each(($element) => cy.wrap($element).attachFile(FIXTURE_PATH));
cy.get(cellRootSelector).should('have.length', helperTextViews.length);

cy.matchImageSnapshot();
});

it('_hasAttachment=false', () => {
mount(
<CypressTestDecoratorWithTypo>
Expand Down Expand Up @@ -113,6 +133,25 @@ describe('plasma-web: Attach', () => {
cy.matchImageSnapshot();
});

it('_flow with helperText', () => {
mount(
<CypressTestDecoratorWithTypo>
{flows.map((flow) => (
<>
<Attach flow={flow} helperText="helperText" />
<PadMe />
<PadMe />
<PadMe />
</>
))}
</CypressTestDecoratorWithTypo>,
);
cy.get(inputSelector).each(($element) => cy.wrap($element).attachFile(FIXTURE_PATH));
cy.get(cellRootSelector).should('have.length', flows.length);

cy.matchImageSnapshot();
});

it('filenameTruncation flow:auto', () => {
mount(
<CypressTestDecoratorWithTypo>
Expand Down

0 comments on commit e1d27be

Please sign in to comment.