diff --git a/README.md b/README.md index 44a6dee..09d8188 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# ticker-frontend [![Integration](https://github.com/systemli/ticker-frontend/actions/workflows/integration.yaml/badge.svg)](https://github.com/systemli/ticker-frontend/actions/workflows/integration.yaml) +# ticker-frontend + +[![Integration](https://github.com/systemli/ticker-frontend/actions/workflows/integration.yaml/badge.svg)](https://github.com/systemli/ticker-frontend/actions/workflows/integration.yaml) [![codecov](https://codecov.io/gh/systemli/ticker-frontend/branch/main/graph/badge.svg?token=bjZUlRawuh)](https://codecov.io/gh/systemli/ticker-frontend) ## Development diff --git a/src/App.test.tsx b/src/App.test.tsx index a0f6179..af11f28 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -26,10 +26,10 @@ describe('App', function () { domain: 'example.com', information: { author: 'Systemli Ticker Team', - url: '', - email: '', - twitter: '', - facebook: '', + url: 'https://demoticker.org', + email: 'admin@demoticker.org', + twitter: 'systemli', + facebook: 'betternot', }, } as Ticker @@ -44,6 +44,23 @@ describe('App', function () { ).toBeInTheDocument() }) + test('renders ErrorView', async function () { + jest.spyOn(api, 'getInit').mockRejectedValue( + new Error( + 'The server responses with an error: Internal Server Error (500)' + ) + ) + render() + + expect(screen.getByText('Loading')).toBeInTheDocument() + + expect( + await screen.findByText( + 'There seems to be a problem connecting to the server.' + ) + ).toBeInTheDocument() + }) + test('renders InactiveView', async function () { jest.spyOn(api, 'getInit').mockResolvedValue({ data: {