Fix tests
This commit is contained in:
@ -9,6 +9,7 @@ export type LightIconButtonSize = 'small' | 'medium';
|
|||||||
|
|
||||||
export type LightIconButtonProps = {
|
export type LightIconButtonProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
|
testId?: string;
|
||||||
Icon?: IconComponent;
|
Icon?: IconComponent;
|
||||||
title?: string;
|
title?: string;
|
||||||
size?: LightIconButtonSize;
|
size?: LightIconButtonSize;
|
||||||
@ -81,6 +82,7 @@ const StyledButton = styled.button<
|
|||||||
export const LightIconButton = ({
|
export const LightIconButton = ({
|
||||||
'aria-label': ariaLabel,
|
'aria-label': ariaLabel,
|
||||||
className,
|
className,
|
||||||
|
testId,
|
||||||
Icon,
|
Icon,
|
||||||
active = false,
|
active = false,
|
||||||
size = 'small',
|
size = 'small',
|
||||||
@ -92,6 +94,7 @@ export const LightIconButton = ({
|
|||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
return (
|
return (
|
||||||
<StyledButton
|
<StyledButton
|
||||||
|
data-testid={testId}
|
||||||
aria-label={ariaLabel}
|
aria-label={ariaLabel}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
|
|||||||
@ -44,6 +44,7 @@ export const DropdownMenuHeader = ({
|
|||||||
<StyledHeader {...props}>
|
<StyledHeader {...props}>
|
||||||
{StartIcon && (
|
{StartIcon && (
|
||||||
<LightIconButton
|
<LightIconButton
|
||||||
|
data-testid="dropdown-menu-header-end-icon"
|
||||||
Icon={StartIcon}
|
Icon={StartIcon}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
accent="tertiary"
|
accent="tertiary"
|
||||||
@ -53,6 +54,7 @@ export const DropdownMenuHeader = ({
|
|||||||
<StyledChildrenWrapper>{children}</StyledChildrenWrapper>
|
<StyledChildrenWrapper>{children}</StyledChildrenWrapper>
|
||||||
{EndIcon && (
|
{EndIcon && (
|
||||||
<StyledLightIconButton
|
<StyledLightIconButton
|
||||||
|
testId="dropdown-menu-header-end-icon"
|
||||||
Icon={EndIcon}
|
Icon={EndIcon}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
accent="tertiary"
|
accent="tertiary"
|
||||||
|
|||||||
@ -49,11 +49,15 @@ export const AddCompanyFromHeader: Story = {
|
|||||||
await canvas.findByTestId('company-progress-dropdown-menu'),
|
await canvas.findByTestId('company-progress-dropdown-menu'),
|
||||||
);
|
);
|
||||||
|
|
||||||
const pipelineStageButton = await canvas.findByTestId(
|
const pipelineStageDropdownHeader = await canvas.findByTestId(
|
||||||
'selected-pipeline-stage',
|
'selected-pipeline-stage',
|
||||||
);
|
);
|
||||||
|
|
||||||
await pipelineStageButton.click();
|
const pipelineStageDropdownUnfoldButton = await within(
|
||||||
|
pipelineStageDropdownHeader,
|
||||||
|
).findByTestId('dropdown-menu-header-end-icon');
|
||||||
|
|
||||||
|
await pipelineStageDropdownUnfoldButton.click();
|
||||||
|
|
||||||
const menuItem1 = await canvas.findByTestId('select-pipeline-stage-1');
|
const menuItem1 = await canvas.findByTestId('select-pipeline-stage-1');
|
||||||
|
|
||||||
@ -67,11 +71,15 @@ export const AddCompanyFromHeader: Story = {
|
|||||||
await canvas.findByTestId('company-progress-dropdown-menu'),
|
await canvas.findByTestId('company-progress-dropdown-menu'),
|
||||||
);
|
);
|
||||||
|
|
||||||
const pipelineStageButton = await canvas.findByTestId(
|
const pipelineStageDropdownHeader = await canvas.findByTestId(
|
||||||
'selected-pipeline-stage',
|
'selected-pipeline-stage',
|
||||||
);
|
);
|
||||||
|
|
||||||
await pipelineStageButton.click();
|
const pipelineStageDropdownUnfoldButton = await within(
|
||||||
|
pipelineStageDropdownHeader,
|
||||||
|
).findByTestId('dropdown-menu-header-end-icon');
|
||||||
|
|
||||||
|
await pipelineStageDropdownUnfoldButton.click();
|
||||||
|
|
||||||
const menuItem1 = await canvas.findByTestId('select-pipeline-stage-1');
|
const menuItem1 = await canvas.findByTestId('select-pipeline-stage-1');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user