Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
DakEnviy committed Dec 22, 2023
1 parent 8bc2a07 commit b7ec173
Show file tree
Hide file tree
Showing 17 changed files with 66 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
"playwright:install": "playwright install --with-deps",
"playwright": "playwright test --config=playwright/playwright.config.ts",
"playwright:update": "npm run playwright -- -u",
"playwright:docker": "docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.39.0-jammy /bin/bash -c 'npm ci && npx playwright install && npm run playwright'",
"playwright:docker:update": " docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.39.0-jammy /bin/bash -c 'npm ci && npx playwright install && npm run playwright:update'"
"playwright:docker": "docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.40.0-jammy /bin/bash -c 'npm ci && npx playwright install && npm run playwright'",
"playwright:docker:update": "docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.40.0-jammy /bin/bash -c 'npm ci && npx playwright install && npm run playwright:update'"
},
"dependencies": {
"@bem-react/classname": "^1.6.0",
Expand Down
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.
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.
51 changes: 51 additions & 0 deletions src/components/Avatar/__tests__/Avatar.visual.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import React from 'react';

import {expect} from '@playwright/experimental-ct-react';

import {Icon, Image, ImageFallback, Showcase, Text, TextInitials, WithBorder} from './stories';

import {test} from '~playwright/core';

test.describe('Avatar', () => {
test('render story: <Image>', async ({mount}) => {
const component = await mount(<Image />);

await expect(component).toHaveScreenshot();
});

test('render story: <ImageFallback>', async ({mount}) => {
const component = await mount(<ImageFallback />);

await expect(component).toHaveScreenshot();
});

test('render story: <Icon>', async ({mount}) => {
const component = await mount(<Icon />);

await expect(component).toHaveScreenshot();
});

test('render story: <Text>', async ({mount}) => {
const component = await mount(<Text />);

await expect(component).toHaveScreenshot();
});

test('render story: <TextInitials>', async ({mount}) => {
const component = await mount(<TextInitials />);

await expect(component).toHaveScreenshot();
});

test('render story: <WithBorder>', async ({mount}) => {
const component = await mount(<WithBorder />);

await expect(component).toHaveScreenshot();
});

test('render story: <Showcase>', async ({mount}) => {
const component = await mount(<Showcase />);

await expect(component).toHaveScreenshot();
});
});
13 changes: 13 additions & 0 deletions src/components/Avatar/__tests__/stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {composeStories} from '@storybook/react';

import * as Stories from '../__stories__/Avatar.stories';

export const {
Image,
ImageFallback,
Icon,
Text,
TextInitials,
WithBorder,
AvatarShowcase: Showcase,
} = composeStories(Stories);

0 comments on commit b7ec173

Please sign in to comment.