Improve test coverage (#6244)

This commit is contained in:
Charles Bochet
2024-07-13 17:57:13 +02:00
committed by GitHub
parent 1e48fe2b74
commit dc6e27e388
7 changed files with 153 additions and 17 deletions

View File

@ -1,8 +1,8 @@
import React from 'react';
import { Link } from 'react-router-dom';
import isPropValid from '@emotion/is-prop-valid';
import { css, useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import React from 'react';
import { Link } from 'react-router-dom';
import { IconComponent, Pill } from 'twenty-ui';
export type ButtonSize = 'medium' | 'small';
@ -27,6 +27,7 @@ export type ButtonProps = {
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
to?: string;
target?: string;
dataTestId?: string;
} & React.ComponentProps<'button'>;
const StyledButton = styled('button', {
@ -374,6 +375,7 @@ export const Button = ({
onClick,
to,
target,
dataTestId,
}: ButtonProps) => {
const theme = useTheme();
@ -393,6 +395,7 @@ export const Button = ({
to={to}
as={to ? Link : 'button'}
target={target}
data-testid={dataTestId}
>
{Icon && <Icon size={theme.icon.size.sm} />}
{title}