mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-18 20:46:19 +00:00
Set default theme based on system preferences
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { createMemoryHistory } from 'history';
|
||||
import { Router } from 'react-router-dom';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { AppFactory } from '../../src/app/App';
|
||||
import { checkAccessibility } from '../__helpers__/accessibility';
|
||||
|
||||
@@ -18,22 +17,17 @@ describe('<App />', () => {
|
||||
ShlinkVersionsContainer: () => <>ShlinkVersions</>,
|
||||
}),
|
||||
);
|
||||
const setUp = (activeRoute = '/') => {
|
||||
const history = createMemoryHistory();
|
||||
history.push(activeRoute);
|
||||
|
||||
return render(
|
||||
<Router location={history.location} navigator={history}>
|
||||
<App
|
||||
fetchServers={() => {}}
|
||||
servers={{}}
|
||||
settings={fromPartial({})}
|
||||
appUpdated
|
||||
resetAppUpdate={() => {}}
|
||||
/>
|
||||
</Router>,
|
||||
);
|
||||
};
|
||||
const setUp = (activeRoute = '/') => render(
|
||||
<MemoryRouter initialEntries={[{ pathname: activeRoute }]}>
|
||||
<App
|
||||
fetchServers={() => {}}
|
||||
servers={{}}
|
||||
settings={fromPartial({})}
|
||||
appUpdated
|
||||
resetAppUpdate={() => {}}
|
||||
/>
|
||||
</MemoryRouter>,
|
||||
);
|
||||
|
||||
it('passes a11y checks', () => checkAccessibility(setUp()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user