Fix tests

This commit is contained in:
Charles Bochet
2023-10-05 16:16:02 +02:00
parent 73fa968595
commit a04bdc6824
3 changed files with 17 additions and 4 deletions

View File

@ -9,6 +9,7 @@ export type LightIconButtonSize = 'small' | 'medium';
export type LightIconButtonProps = {
className?: string;
testId?: string;
Icon?: IconComponent;
title?: string;
size?: LightIconButtonSize;
@ -81,6 +82,7 @@ const StyledButton = styled.button<
export const LightIconButton = ({
'aria-label': ariaLabel,
className,
testId,
Icon,
active = false,
size = 'small',
@ -92,6 +94,7 @@ export const LightIconButton = ({
const theme = useTheme();
return (
<StyledButton
data-testid={testId}
aria-label={ariaLabel}
onClick={onClick}
disabled={disabled}

View File

@ -44,6 +44,7 @@ export const DropdownMenuHeader = ({
<StyledHeader {...props}>
{StartIcon && (
<LightIconButton
data-testid="dropdown-menu-header-end-icon"
Icon={StartIcon}
onClick={onClick}
accent="tertiary"
@ -53,6 +54,7 @@ export const DropdownMenuHeader = ({
<StyledChildrenWrapper>{children}</StyledChildrenWrapper>
{EndIcon && (
<StyledLightIconButton
testId="dropdown-menu-header-end-icon"
Icon={EndIcon}
onClick={onClick}
accent="tertiary"

View File

@ -49,11 +49,15 @@ export const AddCompanyFromHeader: Story = {
await canvas.findByTestId('company-progress-dropdown-menu'),
);
const pipelineStageButton = await canvas.findByTestId(
const pipelineStageDropdownHeader = await canvas.findByTestId(
'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');
@ -67,11 +71,15 @@ export const AddCompanyFromHeader: Story = {
await canvas.findByTestId('company-progress-dropdown-menu'),
);
const pipelineStageButton = await canvas.findByTestId(
const pipelineStageDropdownHeader = await canvas.findByTestId(
'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');