diff --git a/packages/module/src/DetailsPageHeader/DetailsPageHeader.test.tsx b/packages/module/src/DetailsPageHeader/DetailsPageHeader.test.tsx index afb86d83..c24371e5 100644 --- a/packages/module/src/DetailsPageHeader/DetailsPageHeader.test.tsx +++ b/packages/module/src/DetailsPageHeader/DetailsPageHeader.test.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-props-no-spreading */ import { render, screen, fireEvent } from '@testing-library/react'; import React from 'react'; import { MemoryRouter, Routes, Route } from 'react-router-dom'; diff --git a/packages/module/src/ErrorBoundaryPage/__tests__/ErrorBoundaryPage.test.tsx b/packages/module/src/ErrorBoundaryPage/ErrorBoundaryPage.test.tsx similarity index 98% rename from packages/module/src/ErrorBoundaryPage/__tests__/ErrorBoundaryPage.test.tsx rename to packages/module/src/ErrorBoundaryPage/ErrorBoundaryPage.test.tsx index 74fd5ebf..333f0021 100644 --- a/packages/module/src/ErrorBoundaryPage/__tests__/ErrorBoundaryPage.test.tsx +++ b/packages/module/src/ErrorBoundaryPage/ErrorBoundaryPage.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import ErrorBoundaryPage from '../ErrorBoundaryPage'; +import ErrorBoundaryPage from './ErrorBoundaryPage'; import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; diff --git a/packages/module/src/ErrorState/ErrorState.test.tsx b/packages/module/src/ErrorState/ErrorState.test.tsx new file mode 100644 index 00000000..b410264f --- /dev/null +++ b/packages/module/src/ErrorState/ErrorState.test.tsx @@ -0,0 +1,22 @@ +import * as React from 'react'; +import ErrorState from './ErrorState'; +import { render, screen } from '@testing-library/react'; + +describe('ErrorState component', () => { + + it('should render correctly', () => { + render(); + + expect(screen.getByText('A Basic Error')).toBeVisible(); + expect(screen.getByText('The following is an example of a basic error')).toBeVisible(); + expect(screen.getByText('Go to home page')).toBeVisible(); + }); + + it('should render correctly with default props', () => { + render(); + + expect(screen.getByText('Something went wrong')).toBeVisible(); + expect(screen.getByText('Go to home page')).toBeVisible(); + }); + +}); diff --git a/packages/module/src/ErrorState/ErrorState.tsx b/packages/module/src/ErrorState/ErrorState.tsx index 105188d2..3b830d0b 100644 --- a/packages/module/src/ErrorState/ErrorState.tsx +++ b/packages/module/src/ErrorState/ErrorState.tsx @@ -28,7 +28,7 @@ export interface ErrorStateProps extends Omit { defaulErrorDescription?: React.ReactNode; } -const ErrorState: React.FunctionComponent = ({ errorTitle = 'Something went wrong', errorDescription, defaulErrorDescription = null, ...props }: ErrorStateProps) => { +const ErrorState: React.FunctionComponent = ({ errorTitle = 'Something went wrong', errorDescription, defaulErrorDescription, ...props }: ErrorStateProps) => { const classes = useStyles(); return (