-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(TabbarItem): add screenshots tests to component (#7477)
- Loading branch information
1 parent
0f5391d
commit c48038f
Showing
6 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
packages/vkui/src/components/TabbarItem/TabbarItem.e2e-playground.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,34 @@ | ||
import { Icon28MessageOutline } from '@vkontakte/icons'; | ||
import { ComponentPlayground, type ComponentPlaygroundProps } from '@vkui-e2e/playground-helpers'; | ||
import { Badge } from '../Badge/Badge'; | ||
import { Tabbar, type TabbarProps } from '../Tabbar/Tabbar'; | ||
import { TabbarItem, type TabbarItemProps } from './TabbarItem'; | ||
|
||
export const TabbarItemPlayground = (playgroundProps: ComponentPlaygroundProps) => { | ||
return ( | ||
<ComponentPlayground | ||
{...playgroundProps} | ||
propSets={[ | ||
{ | ||
mode: ['vertical', 'horizontal'], | ||
text: ['Message'], | ||
children: [<Icon28MessageOutline key="icon" />], | ||
indicator: [undefined, <Badge key="badge" />], | ||
disabled: [false, true], | ||
}, | ||
{ | ||
mode: ['horizontal'], | ||
text: ['Message'], | ||
children: [<Icon28MessageOutline key="icon" />], | ||
selected: [true, false], | ||
}, | ||
]} | ||
> | ||
{(props: TabbarItemProps & Pick<TabbarProps, 'mode'>) => ( | ||
<Tabbar mode={props.mode} style={{ position: 'relative' }}> | ||
<TabbarItem {...props} /> | ||
</Tabbar> | ||
)} | ||
</ComponentPlayground> | ||
); | ||
}; |
13 changes: 13 additions & 0 deletions
13
packages/vkui/src/components/TabbarItem/TabbarItem.e2e.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,13 @@ | ||
import { test } from '@vkui-e2e/test'; | ||
import { TabbarItemPlayground } from './TabbarItem.e2e-playground'; | ||
|
||
test.use({ onlyForPlatforms: ['android', 'ios'] }); | ||
|
||
test('TabbarItem', async ({ | ||
mount, | ||
expectScreenshotClippedToContent, | ||
componentPlaygroundProps, | ||
}) => { | ||
await mount(<TabbarItemPlayground {...componentPlaygroundProps} />); | ||
await expectScreenshotClippedToContent(); | ||
}); |
3 changes: 3 additions & 0 deletions
3
...ents/TabbarItem/__image_snapshots__/tabbaritem-android-chromium-dark-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...nts/TabbarItem/__image_snapshots__/tabbaritem-android-chromium-light-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...components/TabbarItem/__image_snapshots__/tabbaritem-ios-webkit-dark-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...omponents/TabbarItem/__image_snapshots__/tabbaritem-ios-webkit-light-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.