Add tests on top of ui/buttons, ui/links and ui/inputs (#342)

This commit is contained in:
Charles Bochet
2023-06-21 03:47:00 +02:00
committed by GitHub
parent e2eb40c1ea
commit e2d8c3a2ec
14 changed files with 284 additions and 61 deletions

View File

@ -4,7 +4,7 @@ import { isValidPhoneNumber, parsePhoneNumber } from 'libphonenumber-js';
import { textInputStyle } from '@/ui/layout/styles/themes';
import Link from '../../link/Link';
import { RawLink } from '../../links/RawLink';
import { EditableCell } from '../EditableCell';
type OwnProps = {
@ -50,7 +50,7 @@ export function EditablePhone({ value, placeholder, changeHandler }: OwnProps) {
nonEditModeContent={
<div>
{isValidPhoneNumber(inputValue) ? (
<Link
<RawLink
href={parsePhoneNumber(inputValue, 'FR')?.getURI()}
onClick={(event: MouseEvent<HTMLElement>) => {
event.stopPropagation();
@ -58,9 +58,9 @@ export function EditablePhone({ value, placeholder, changeHandler }: OwnProps) {
>
{parsePhoneNumber(inputValue, 'FR')?.formatInternational() ||
inputValue}
</Link>
</RawLink>
) : (
<Link href="#">{inputValue}</Link>
<RawLink href="#">{inputValue}</RawLink>
)}
</div>
}