Simon
2 months ago
4 changed files with 35 additions and 15 deletions
@ -0,0 +1,17 @@
|
||||
import { |
||||
describe, |
||||
expect, |
||||
test |
||||
} from 'vitest'; |
||||
import { render } from '@testing-library/react' |
||||
import { |
||||
ErrorText |
||||
} from './ErrorText' |
||||
|
||||
|
||||
describe('ErrorText', () => { |
||||
test('it renders with the text', () => { |
||||
const { queryByTestId } = render(<ErrorText data-testid="test-id">An Error has occured!</ErrorText>) |
||||
expect(queryByTestId('test-id')?.textContent).toEqual('An Error has occured!') |
||||
}) |
||||
}) |
@ -0,0 +1,7 @@
|
||||
import { Typography, TypographyProps, } from "@mui/material"; |
||||
|
||||
export const ErrorText: React.FunctionComponent<TypographyProps> = ({ ...props }) => { |
||||
return ( |
||||
<Typography color="error" {...props} /> |
||||
) |
||||
} |
Loading…
Reference in new issue