-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(plasma-b2c): update tests for ButtonGroup and IconButton
- Loading branch information
Showing
28 changed files
with
288 additions
and
1 deletion.
There are no files selected for viewing
Binary file added
BIN
+6.75 KB
...lasma-b2c ButtonGroup -- [PLASMA-T1206] ButtonGroup size=s, view=clear.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.44 KB
...lasma-b2c ButtonGroup -- [PLASMA-T1207] ButtonGroup size=xs, gap=dense.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.2 KB
...[PLASMA-T820] ButtonGroup view=default, size=m, orientation=horizontal.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.5 KB
...nGroup -- [PLASMA-T821] ButtonGroup view=accent, size=l, shape=default.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.68 KB
...-b2c ButtonGroup -- [PLASMA-T822] ButtonGroup view=secondary, gap=none.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.3 KB
...nGroup -- [PLASMA-T823] ButtonGroup view=success, orientation=vertical.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.21 KB
...ButtonGroup -- [PLASMA-T824] ButtonGroup view=warning, shape=segmented.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.13 KB
...tonGroup -- [PLASMA-T825] ButtonGroup view=critical, stretching=filled.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.75 KB
...plasma-b2c ButtonGroup -- [PLASMA-T826] ButtonGroup size=xxs, gap=wide.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-7.75 KB
...IconButton/IconButton.component-test.tsx/plasma-web IconButton -- _pin.snap.png
Binary file not shown.
Binary file removed
BIN
-5.39 KB
...conButton/IconButton.component-test.tsx/plasma-web IconButton -- _size.snap.png
Binary file not shown.
Binary file removed
BIN
-12.6 KB
...conButton/IconButton.component-test.tsx/plasma-web IconButton -- _view.snap.png
Binary file not shown.
Binary file removed
BIN
-7.97 KB
...ton/IconButton.component-test.tsx/plasma-web IconButton -- with Loader.snap.png
Binary file not shown.
File renamed without changes
Binary file added
BIN
+3.04 KB
.../plasma-b2c IconButton -- [PLASMA-T926] IconButton view=accent, size=l.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.65 KB
...asma-b2c IconButton -- [PLASMA-T927] IconButton view=secondary, size=s.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.67 KB
...lasma-b2c IconButton -- [PLASMA-T928] IconButton view=success, size=xs.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.17 KB
...sma-b2c IconButton -- [PLASMA-T929] IconButton view=warning, isLoading.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.8 KB
...nt-test.tsx/plasma-b2c IconButton -- [PLASMA-T930] IconButton disabled.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.53 KB
...IconButton -- [PLASMA-T931] IconButton view=critical, pin=square-clear.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.22 KB
...2c IconButton -- [PLASMA-T932] IconButton view=clear, pin=clear-square.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.24 KB
....tsx/plasma-b2c IconButton -- [PLASMA-T933] IconButton pin=clear-clear.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.92 KB
...tsx/plasma-b2c IconButton -- [PLASMA-T934] IconButton pin=clear-circle.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.95 KB
...tsx/plasma-b2c IconButton -- [PLASMA-T935] IconButton pin=circle-clear.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.54 KB
...sx/plasma-b2c IconButton -- [PLASMA-T936] IconButton pin=circle-circle.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
124 changes: 124 additions & 0 deletions
124
packages/plasma-b2c/src/components/ButtonGroup/ButtonGroup.update-test.component-test.tsx
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,124 @@ | ||
import React from 'react'; | ||
import { mount, CypressTestDecorator, getComponent } from '@salutejs/plasma-cy-utils'; | ||
|
||
describe('plasma-b2c: ButtonGroup', () => { | ||
const ButtonGroup = getComponent('ButtonGroup'); | ||
const Button = getComponent('Button'); | ||
|
||
const getButtons = () => [ | ||
<Button text="Button" />, | ||
<Button text="Button" />, | ||
<Button text="Button" />, | ||
<Button text="Button" />, | ||
<Button text="Button" />, | ||
]; | ||
|
||
it('[PLASMA-T820] ButtonGroup: view=default, size=m, orientation=horizontal', () => { | ||
mount( | ||
<CypressTestDecorator> | ||
<ButtonGroup view="default" size="m" orientation="horizontal"> | ||
{getButtons()} | ||
</ButtonGroup> | ||
</CypressTestDecorator>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T821] ButtonGroup: view=accent, size=l, shape=default', () => { | ||
mount( | ||
<CypressTestDecorator> | ||
<ButtonGroup view="accent" size="l" shape="default"> | ||
{getButtons()} | ||
</ButtonGroup> | ||
</CypressTestDecorator>, | ||
); | ||
|
||
cy.viewport(1366, 768); | ||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T822] ButtonGroup: view=secondary, gap=none', () => { | ||
mount( | ||
<CypressTestDecorator> | ||
<ButtonGroup view="secondary" gap="none"> | ||
{getButtons()} | ||
</ButtonGroup> | ||
</CypressTestDecorator>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T823] ButtonGroup: view=success, orientation=vertical', () => { | ||
mount( | ||
<CypressTestDecorator> | ||
<ButtonGroup view="success" orientation="vertical"> | ||
{getButtons()} | ||
</ButtonGroup> | ||
</CypressTestDecorator>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T824] ButtonGroup: view=warning, shape=segmented', () => { | ||
mount( | ||
<CypressTestDecorator> | ||
<ButtonGroup view="warning" shape="segmented"> | ||
{getButtons()} | ||
</ButtonGroup> | ||
</CypressTestDecorator>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T825] ButtonGroup: view=critical, stretching=filled', () => { | ||
mount( | ||
<CypressTestDecorator> | ||
<ButtonGroup view="critical" stretching="filled"> | ||
{getButtons()} | ||
</ButtonGroup> | ||
</CypressTestDecorator>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T826] ButtonGroup: size=xxs, gap=wide', () => { | ||
mount( | ||
<CypressTestDecorator> | ||
<ButtonGroup size="xxs" gap="wide"> | ||
{getButtons()} | ||
</ButtonGroup> | ||
</CypressTestDecorator>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T1206] ButtonGroup: size=s, view=clear', () => { | ||
mount( | ||
<CypressTestDecorator> | ||
<ButtonGroup size="s" view="clear"> | ||
{getButtons()} | ||
</ButtonGroup> | ||
</CypressTestDecorator>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T1207] ButtonGroup: size=xs, gap=dense', () => { | ||
mount( | ||
<CypressTestDecorator> | ||
<ButtonGroup size="xs" gap="dense"> | ||
{getButtons()} | ||
</ButtonGroup> | ||
</CypressTestDecorator>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
}); |
1 change: 0 additions & 1 deletion
1
packages/plasma-b2c/src/components/IconButton/IconButton.component-test.tsx
This file was deleted.
Oops, something went wrong.
164 changes: 164 additions & 0 deletions
164
packages/plasma-b2c/src/components/IconButton/IconButton.update-test.component-test.tsx
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,164 @@ | ||
import React from 'react'; | ||
import type { FC, PropsWithChildren } from 'react'; | ||
import { IconClose } from '@salutejs/plasma-icons'; | ||
import { standard as standardTypo } from '@salutejs/plasma-typo'; | ||
import { createGlobalStyle } from 'styled-components'; | ||
import { mount, CypressTestDecorator, getComponent } from '@salutejs/plasma-cy-utils'; | ||
|
||
const Icon = () => <IconClose color="inherit" />; | ||
const StandardTypoStyle = createGlobalStyle(standardTypo); | ||
|
||
describe('plasma-b2c: IconButton', () => { | ||
const IconButton = getComponent('IconButton'); | ||
|
||
const CypressTestDecoratorWithTypo: FC<PropsWithChildren> = ({ children }) => ( | ||
<CypressTestDecorator> | ||
<StandardTypoStyle /> | ||
{children} | ||
</CypressTestDecorator> | ||
); | ||
|
||
it('[PLASMA-T925] IconButton: view=default, size=m', () => { | ||
mount( | ||
<CypressTestDecoratorWithTypo> | ||
<IconButton view="default" size="m"> | ||
<Icon size="s" /> | ||
</IconButton> | ||
</CypressTestDecoratorWithTypo>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T926] IconButton: view=accent, size=l', () => { | ||
mount( | ||
<CypressTestDecoratorWithTypo> | ||
<IconButton view="accent" size="l"> | ||
<Icon size="s" /> | ||
</IconButton> | ||
</CypressTestDecoratorWithTypo>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T927] IconButton: view=secondary, size=s', () => { | ||
mount( | ||
<CypressTestDecoratorWithTypo> | ||
<IconButton view="secondary" size="s"> | ||
<Icon size="s" /> | ||
</IconButton> | ||
</CypressTestDecoratorWithTypo>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T928] IconButton: view=success, size=xs', () => { | ||
mount( | ||
<CypressTestDecoratorWithTypo> | ||
<IconButton view="success" size="xs"> | ||
<Icon size="s" /> | ||
</IconButton> | ||
</CypressTestDecoratorWithTypo>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T929] IconButton: view=warning, isLoading', () => { | ||
mount( | ||
<CypressTestDecoratorWithTypo> | ||
<IconButton view="warning" isLoading> | ||
<Icon size="s" /> | ||
</IconButton> | ||
</CypressTestDecoratorWithTypo>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T930] IconButton: disabled', () => { | ||
mount( | ||
<CypressTestDecoratorWithTypo> | ||
<IconButton disabled> | ||
<Icon size="s" /> | ||
</IconButton> | ||
</CypressTestDecoratorWithTypo>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T931] IconButton: view=critical, pin=square-clear', () => { | ||
mount( | ||
<CypressTestDecoratorWithTypo> | ||
<IconButton view="critical" pin="square-clear"> | ||
<Icon size="s" /> | ||
</IconButton> | ||
</CypressTestDecoratorWithTypo>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T932] IconButton: view=clear, pin=clear-square', () => { | ||
mount( | ||
<CypressTestDecoratorWithTypo> | ||
<IconButton view="clear" pin="clear-square"> | ||
<Icon size="s" /> | ||
</IconButton> | ||
</CypressTestDecoratorWithTypo>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T933] IconButton: pin=clear-clear', () => { | ||
mount( | ||
<CypressTestDecoratorWithTypo> | ||
<IconButton pin="clear-clear"> | ||
<Icon size="s" /> | ||
</IconButton> | ||
</CypressTestDecoratorWithTypo>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T934] IconButton: pin=clear-circle', () => { | ||
mount( | ||
<CypressTestDecoratorWithTypo> | ||
<IconButton pin="clear-circle"> | ||
<Icon size="s" /> | ||
</IconButton> | ||
</CypressTestDecoratorWithTypo>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T935] IconButton: pin=circle-clear', () => { | ||
mount( | ||
<CypressTestDecoratorWithTypo> | ||
<IconButton pin="circle-clear"> | ||
<Icon size="s" /> | ||
</IconButton> | ||
</CypressTestDecoratorWithTypo>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
|
||
it('[PLASMA-T936] IconButton: pin=circle-circle', () => { | ||
mount( | ||
<CypressTestDecoratorWithTypo> | ||
<IconButton pin="circle-circle"> | ||
<Icon size="s" /> | ||
</IconButton> | ||
</CypressTestDecoratorWithTypo>, | ||
); | ||
|
||
cy.matchImageSnapshot(); | ||
}); | ||
}); |