Skip to content

Commit

Permalink
fix: rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
amje committed Dec 28, 2024
1 parent 8f218d8 commit 65b4a65
Show file tree
Hide file tree
Showing 80 changed files with 122 additions and 150 deletions.
1 change: 0 additions & 1 deletion README-ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ npm install --save-dev @gravity-ui/uikit
## Использование

```jsx
import React from 'react';
import {Button} from '@gravity-ui/uikit';

const SubmitButton = <Button view="action" size="l" />;
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ npm install --save-dev @gravity-ui/uikit
## Usage

```jsx
import React from 'react';
import {Button} from '@gravity-ui/uikit';

const SubmitButton = <Button view="action" size="l" />;
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 3 additions & 9 deletions playwright/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

Capture a screenshot, by default in light theme only:

```ts
import React from 'react';

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

import {MyComponent} from '../MyComponent';
Expand All @@ -28,9 +26,7 @@

You can also capture screenshots both in dark and light themes:

```ts
import React from 'react';

```tsx
import {MyComponent} from '../MyComponent';

import {test} from '~playwright/core';
Expand All @@ -46,9 +42,7 @@

If you need to do any actions with the component:

```ts
import React from 'react';

```tsx
import {MyComponent} from '../MyComponent';

import {test} from '~playwright/core';
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.
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.
25 changes: 9 additions & 16 deletions src/components/Avatar/__tests__/Avatar.visual.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import {smokeTest, test} from '~playwright/core';

import {createSmokeScenarios} from '../../../stories/tests-factory/create-smoke-scenarios';
import {Avatar} from '../Avatar';
import type {AvatarProps} from '../types/main';

import {
backgroundColorCases,
Expand All @@ -12,7 +10,8 @@ import {
titleCases,
viewCases,
} from './cases';
import {TestAvatarWithIcon, TestAvatarWithImage} from './helpersPlaywright';
import {TestAvatarWithIcon, TestAvatarWithImage, TestAvatarWithText} from './helpersPlaywright';
import type {TestAvatarProps} from './helpersPlaywright';
import {AvatarStories} from './stories';

test.describe('Avatar', {tag: '@Avatar'}, () => {
Expand Down Expand Up @@ -53,8 +52,6 @@ test.describe('Avatar', {tag: '@Avatar'}, () => {
await expectScreenshot({component});
});

const defaultProps: AvatarProps = {};

const commonCases = {
size: sizeCases,
theme: themeCases,
Expand All @@ -65,8 +62,8 @@ test.describe('Avatar', {tag: '@Avatar'}, () => {
} as const;

smokeTest('with image', async ({mount, expectScreenshot}) => {
const smokeScenarios = createSmokeScenarios(
defaultProps,
const smokeScenarios = createSmokeScenarios<TestAvatarProps>(
{},
{
...commonCases,
},
Expand Down Expand Up @@ -94,8 +91,8 @@ test.describe('Avatar', {tag: '@Avatar'}, () => {
});

smokeTest('with icon', async ({mount, expectScreenshot}) => {
const smokeScenarios = createSmokeScenarios(
defaultProps,
const smokeScenarios = createSmokeScenarios<TestAvatarProps>(
{},
{
...commonCases,
},
Expand Down Expand Up @@ -123,12 +120,8 @@ test.describe('Avatar', {tag: '@Avatar'}, () => {
});

smokeTest('with text', async ({mount, expectScreenshot}) => {
const smokeScenarios = createSmokeScenarios(
{
...defaultProps,
text: 'Text',
color: 'black',
},
const smokeScenarios = createSmokeScenarios<TestAvatarProps>(
{},
{
...commonCases,
},
Expand All @@ -143,7 +136,7 @@ test.describe('Avatar', {tag: '@Avatar'}, () => {
<div key={title}>
<h4>{title}</h4>
<div>
<Avatar {...props} />
<TestAvatarWithText {...props} />
</div>
</div>
))}
Expand Down
10 changes: 8 additions & 2 deletions src/components/Avatar/__tests__/helpersPlaywright.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import {FaceRobot} from '@gravity-ui/icons';
import {Avatar} from '../Avatar';
import type {AvatarProps} from '../types/main';

export const TestAvatarWithImage = (props: AvatarProps) => {
export type TestAvatarProps = Omit<AvatarProps, 'imgUrl' | 'icon' | 'text'>;

export const TestAvatarWithImage = (props: TestAvatarProps) => {
return (
<Avatar
imgUrl={
Expand All @@ -14,6 +16,10 @@ export const TestAvatarWithImage = (props: AvatarProps) => {
);
};

export const TestAvatarWithIcon = (props: AvatarProps) => {
export const TestAvatarWithIcon = (props: TestAvatarProps) => {
return <Avatar icon={FaceRobot} {...props} />;
};

export const TestAvatarWithText = (props: TestAvatarProps) => {
return <Avatar text="Text" color="black" {...props} />;
};
2 changes: 1 addition & 1 deletion src/components/Dialog/DialogPrivateContext.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';

export interface DialogPrivateContextProps {
initialFocusRef?: React.RefObject<HTMLElement | null>;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Link/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ LANDING_BLOCK-->
`Link` accepts any valid `a` element props in addition to these:

| Name | Description | Type | Default |
| :-------- |:-------------------------------------------| :----------------------------------: | :--------: |
| :-------- | :----------------------------------------- | :----------------------------------: | :--------: |
| children | `Link` content | `React.ReactNode` | |
| href | `href` HTML attribute | `string` | |
| qa | `data-qa` HTML attribute, used for testing | `string` | |
Expand Down
4 changes: 2 additions & 2 deletions src/components/Modal/README-ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import {Modal} from '@gravity-ui/uikit';
## Использование

```tsx
import React from 'react';
import {useState} from 'react';
import {Button, Modal} from '@gravity-ui/uikit';

const [open, setOpen] = React.useState(false);
const [open, setOpen] = useState(false);

<Button onClick={() => setOpen(true)}>Open Modal</Button>
<Modal open={open} onClose={() => setOpen(false)}>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Modal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ With `Modal`, you can implement dialogs, alerts, confirmations, and more.
## Usage

```tsx
import React from 'react';
import {useState} from 'react';
import {Button, Modal} from '@gravity-ui/uikit';

const [open, setOpen] = React.useState(false);
const [open, setOpen] = useState(false);

<Button onClick={() => setOpen(true)}>Open Modal</Button>
<Modal open={open} onClose={() => setOpen(false)}>
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

0 comments on commit 65b4a65

Please sign in to comment.