Improve tests (#871)

This commit is contained in:
Charles Bochet
2023-07-24 00:57:56 -07:00
committed by GitHub
parent 2b885f2496
commit 07180af8c0
53 changed files with 432 additions and 251 deletions

View File

@ -58,7 +58,6 @@ export function EditablePeopleFullName({
<PersonChip
name={`${person?.firstName ?? ''} ${person?.lastName ?? ''}`}
id={person?.id ?? ''}
clickable
/>
</NoEditModeContainer>
}

View File

@ -38,7 +38,7 @@ export function PeopleCompanyCell({ people }: OwnProps) {
<CompanyChip
id={people.company?.id ?? ''}
name={people.company?.name ?? ''}
picture={getLogoUrlFromDomainName(people.company?.domainName)}
pictureUrl={getLogoUrlFromDomainName(people.company?.domainName)}
/>
}
/>

View File

@ -3,24 +3,23 @@ import { EntityChip } from '@/ui/chip/components/EntityChip';
export type PersonChipPropsType = {
id: string;
name: string;
picture?: string;
pictureUrl?: string;
clickable?: boolean;
};
export function PersonChip({
id,
name,
picture,
clickable,
pictureUrl,
clickable = true,
}: PersonChipPropsType) {
return (
<EntityChip
entityId={id}
linkToEntity={`/person/${id}`}
linkToEntity={clickable ? `/person/${id}` : undefined}
name={name}
avatarType="rounded"
clickable={clickable}
picture={picture}
pictureUrl={pictureUrl}
/>
);
}

View File

@ -2,7 +2,7 @@ import { BrowserRouter } from 'react-router-dom';
import styled from '@emotion/styled';
import type { Meta, StoryObj } from '@storybook/react';
import { ComponentDecorator } from '~/testing/decorators';
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
import { PersonChip } from '../PersonChip';
@ -15,7 +15,6 @@ const TestCellContainer = styled.div`
max-width: 250px;
min-width: 250px;
overflow: hidden;
text-wrap: nowrap;
`;
const meta: Meta<typeof PersonChip> = {