Skip to content

Commit

Permalink
Merge pull request #2220 from epam/feat/e2e_improvements
Browse files Browse the repository at this point in the history
Feat/e2e improvements
  • Loading branch information
siarheiyelin authored May 3, 2024
2 parents 075a695 + 593da57 commit 4613429
Show file tree
Hide file tree
Showing 283 changed files with 455 additions and 171 deletions.
7 changes: 1 addition & 6 deletions app/src/docs/Alert.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ import * as loveship from '@epam/loveship';
import * as promo from '@epam/promo';
import { DocBuilder, DocPreviewBuilder, TDocConfig, TDocContext, TSkin } from '@epam/uui-docs';
import { BaseDocsBlock, DocExample, EditableDocContent } from '../common';

enum TAlertPreview {
Colors = 'Colors',
'Layout with icon' = 'Layout with icon',
'Layout without icon' = 'Layout without icon'
}
import { TAlertPreview } from './_types/previewIds';

export class AlertDoc extends BaseDocsBlock {
title = 'Alert';
Expand Down
7 changes: 1 addition & 6 deletions app/src/docs/Badge.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ import {
} from '@epam/uui-docs';
import { BaseDocsBlock, DocExample, EditableDocContent } from '../common';
import { getCurrentTheme } from '../helpers';

enum TBadgePreview {
'Colors' = 'Colors',
'Sizes with icon' = 'Sizes with icon',
'Sizes without icon' = 'Sizes without icon'
}
import { TBadgePreview } from './_types/previewIds';

export class BadgeDoc extends BaseDocsBlock {
title = 'Badge';
Expand Down
8 changes: 1 addition & 7 deletions app/src/docs/Button.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ import {
} from '@epam/uui-docs';
import { BaseDocsBlock, DocExample, EditableDocContent } from '../common';
import { getCurrentTheme } from '../helpers';

enum TButtonPreview {
'One-line caption' = 'One-line caption',
'Two-line caption' = 'Two-line caption',
'No caption' = 'No caption',
Colors = 'Colors'
}
import { TButtonPreview } from './_types/previewIds';

export class ButtonDoc extends BaseDocsBlock {
title = 'Button';
Expand Down
5 changes: 1 addition & 4 deletions app/src/docs/Checkbox.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import * as promo from '@epam/promo';
import * as electric from '@epam/electric';
import { DocPreviewBuilder, TDocConfig, TDocContext, TSkin } from '@epam/uui-docs';
import { BaseDocsBlock, DocExample, EditableDocContent } from '../common';

enum TCheckboxPreview {
Basic = 'Basic'
}
import { TCheckboxPreview } from './_types/previewIds';

export class CheckboxDoc extends BaseDocsBlock {
title = 'Checkbox';
Expand Down
6 changes: 1 addition & 5 deletions app/src/docs/CountIndicator.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ import * as promo from '@epam/promo';
import * as electric from '@epam/electric';
import { DocBuilder, DocPreviewBuilder, TDocConfig, TSkin } from '@epam/uui-docs';
import { BaseDocsBlock, EditableDocContent, DocExample } from '../common';

enum TCountIndicatorPreview {
Colors = 'Colors',
Sizes = 'Sizes'
}
import { TCountIndicatorPreview } from './_types/previewIds';

export class CountIndicatorDoc extends BaseDocsBlock {
title = 'CountIndicator';
Expand Down
6 changes: 1 addition & 5 deletions app/src/docs/IconButton.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ import {
} from '@epam/uui-docs';
import { BaseDocsBlock, DocExample, EditableDocContent } from '../common';
import { getCurrentTheme } from '../helpers';

enum TIconButtonPreview {
Colors = 'Colors',
Layout = 'Layout'
}
import { TIconButtonPreview } from './_types/previewIds';

export class IconButtonDoc extends BaseDocsBlock {
title = 'Icon Button';
Expand Down
8 changes: 1 addition & 7 deletions app/src/docs/LinkButton.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ import {
} from '@epam/uui-docs';
import { EditableDocContent, DocExample, BaseDocsBlock } from '../common';
import { getCurrentTheme } from '../helpers';

enum TLinkButtonPreview {
'One-line caption' = 'One-line caption',
'Two-line caption' = 'Two-line caption',
'No caption' = 'No caption',
Colors = 'Colors'
}
import { TLinkButtonPreview } from './_types/previewIds';

export class LinkButtonDoc extends BaseDocsBlock {
title = 'Link Button';
Expand Down
5 changes: 1 addition & 4 deletions app/src/docs/Switch.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import * as promo from '@epam/promo';
import * as electric from '@epam/electric';
import { BaseDocsBlock, DocExample, EditableDocContent } from '../common';
import { DocPreviewBuilder, TDocConfig, TDocContext, TSkin } from '@epam/uui-docs';

enum TSwitchPreview {
Basic = 'Basic'
}
import { TSwitchPreview } from './_types/previewIds';

export class SwitchDoc extends BaseDocsBlock {
title = 'Switch';
Expand Down
119 changes: 118 additions & 1 deletion app/src/docs/TabButton.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@ import * as uui from '@epam/uui';
import * as loveship from '@epam/loveship';
import * as promo from '@epam/promo';
import * as electric from '@epam/electric';
import { DocBuilder, TDocConfig, TDocContext, TSkin } from '@epam/uui-docs';
import {
DocBuilder,
DocPreviewBuilder,
TComponentPreview,
TDocConfig,
TDocContext,
TPreviewCellSize,
TSkin,
} from '@epam/uui-docs';
import { BaseDocsBlock, DocExample, EditableDocContent } from '../common';
import { TTabButtonPreview } from './_types/previewIds';

export class TabButtonDoc extends BaseDocsBlock {
title = 'Tab Button';
Expand All @@ -21,6 +30,114 @@ export class TabButtonDoc extends BaseDocsBlock {
doc: (doc: DocBuilder<uui.TabButtonProps>) => {
doc.merge('iconPosition', { defaultValue: 'left' });
},
preview: (docPreview: DocPreviewBuilder<uui.TabButtonProps>) => {
const TEST_DATA = {
count: 999,
caption: 'Test',
callback: 'callback',
href: 'https://google.com',
icon: 'action-account-fill.svg',
};
const cellSize: TPreviewCellSize = '190-70';
const baseMatrix: TComponentPreview<uui.TabButtonProps>['matrix'] = {
href: { values: [TEST_DATA.href] },
caption: { values: [TEST_DATA.caption] },
count: { values: [undefined, TEST_DATA.count] },
withNotify: { values: [true, false] },
icon: { examples: [undefined, TEST_DATA.icon] },
iconPosition: { examples: '*', condition: (props) => !!props.icon },
size: { examples: '*' },
};

docPreview.add({
id: TTabButtonPreview['Active'],
matrix: {
isLinkActive: { values: [true] },
isDisabled: { values: [false] },
isDropdown: { values: [false] },
...baseMatrix,
onClear: { examples: [undefined, TEST_DATA.callback] },
},
cellSize,
});
docPreview.add({
id: TTabButtonPreview['Active Disabled'],
matrix: {
isLinkActive: { values: [true] },
isDisabled: { values: [true] },
isDropdown: { values: [false] },
...baseMatrix,
},
cellSize,
});
docPreview.add({
id: TTabButtonPreview['Active Dropdown'],
matrix: {
isLinkActive: { values: [true] },
isDisabled: { values: [false] },
isDropdown: { values: [true] },
isOpen: { values: [false] },
...baseMatrix,
onClear: { examples: [undefined, TEST_DATA.callback] },
},
cellSize,
});
docPreview.add({
id: TTabButtonPreview['Active Dropdown Disabled'],
matrix: {
isLinkActive: { values: [true] },
isDisabled: { values: [true] },
isDropdown: { values: [true] },
isOpen: { values: [false] },
...baseMatrix,
},
cellSize,
});
docPreview.add({
id: TTabButtonPreview['Inactive'],
matrix: {
isLinkActive: { values: [false] },
isDisabled: { values: [false] },
isDropdown: { values: [false] },
...baseMatrix,
onClear: { examples: [undefined, TEST_DATA.callback] },
},
cellSize,
});
docPreview.add({
id: TTabButtonPreview['Inactive Disabled'],
matrix: {
isLinkActive: { values: [false] },
isDisabled: { values: [true] },
isDropdown: { values: [false] },
...baseMatrix,
},
cellSize,
});
docPreview.add({
id: TTabButtonPreview['Inactive Dropdown'],
matrix: {
isLinkActive: { values: [false] },
isDisabled: { values: [false] },
isDropdown: { values: [true] },
isOpen: { values: [false] },
...baseMatrix,
onClear: { examples: [undefined, TEST_DATA.callback] },
},
cellSize,
});
docPreview.add({
id: TTabButtonPreview['Inactive Dropdown Disabled'],
matrix: {
isLinkActive: { values: [false] },
isDisabled: { values: [true] },
isDropdown: { values: [true] },
isOpen: { values: [false] },
...baseMatrix,
},
cellSize,
});
},
};

renderContent() {
Expand Down
8 changes: 1 addition & 7 deletions app/src/docs/Tag.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ import {
} from '@epam/uui-docs';
import { EditableDocContent, DocExample, BaseDocsBlock } from '../common';
import { getCurrentTheme } from '../helpers';

enum TTagPreview {
'One-line caption' = 'One-line caption',
'Two-line caption' = 'Two-line caption',
'No caption' = 'No caption',
Colors = 'Colors'
}
import { TTagPreview } from './_types/previewIds';

export class TagDoc extends BaseDocsBlock {
title = 'Tag';
Expand Down
11 changes: 1 addition & 10 deletions app/src/docs/TextInput.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,7 @@ import * as promo from '@epam/promo';
import * as electric from '@epam/electric';
import { DocBuilder, DocPreviewBuilder, TComponentPreview, TDocConfig, TDocContext, TSkin } from '@epam/uui-docs';
import { BaseDocsBlock, DocExample, EditableDocContent } from '../common';

enum TTextInputPreview {
'Form'= 'Form',
'Form (invalid)'= 'Form (invalid)',
'Form (disabled)'= 'Form (disabled)',
'Form (read only)'= 'Form (read only)',
'Inline'= 'Inline',
'Inline (disabled)'= 'Inline (disabled)',
'Inline (read only)'= 'Inline (read only)'
}
import { TTextInputPreview } from './_types/previewIds';

export class TextInputDoc extends BaseDocsBlock {
title = 'Text Input';
Expand Down
Loading

0 comments on commit 4613429

Please sign in to comment.