mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-04-20 10:05:56 +00:00
Added and tested ErrorText
This commit is contained in:
parent
0e2816f57e
commit
68a80d403c
17
src/components/ErrorText/ErrorText.spec.tsx
Normal file
17
src/components/ErrorText/ErrorText.spec.tsx
Normal file
@ -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!')
|
||||
})
|
||||
})
|
7
src/components/ErrorText/ErrorText.tsx
Normal file
7
src/components/ErrorText/ErrorText.tsx
Normal file
@ -0,0 +1,7 @@
|
||||
import { Typography, TypographyProps, } from "@mui/material";
|
||||
|
||||
export const ErrorText: React.FunctionComponent<TypographyProps> = ({ ...props }) => {
|
||||
return (
|
||||
<Typography color="error" {...props} />
|
||||
)
|
||||
}
|
@ -1 +1,2 @@
|
||||
export * from './PasswordField/PasswordField';
|
||||
export * from './PasswordField/PasswordField';
|
||||
export * from './ErrorText/ErrorText';
|
Loading…
x
Reference in New Issue
Block a user