mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-21 05:56:20 +00:00
Refactor DI approach for components
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { createMemoryHistory } from 'history';
|
||||
import { Router } from 'react-router-dom';
|
||||
import { Settings as createSettings } from '../../src/settings/Settings';
|
||||
import { SettingsFactory } from '../../src/settings/Settings';
|
||||
|
||||
describe('<Settings />', () => {
|
||||
const Settings = createSettings(
|
||||
() => <span>RealTimeUpdates</span>,
|
||||
() => <span>ShortUrlCreation</span>,
|
||||
() => <span>ShortUrlsList</span>,
|
||||
() => <span>UserInterface</span>,
|
||||
() => <span>Visits</span>,
|
||||
() => <span>Tags</span>,
|
||||
);
|
||||
const Settings = SettingsFactory(fromPartial({
|
||||
RealTimeUpdatesSettings: () => <span>RealTimeUpdates</span>,
|
||||
ShortUrlCreationSettings: () => <span>ShortUrlCreation</span>,
|
||||
ShortUrlsListSettings: () => <span>ShortUrlsList</span>,
|
||||
UserInterfaceSettings: () => <span>UserInterface</span>,
|
||||
VisitsSettings: () => <span>Visits</span>,
|
||||
TagsSettings: () => <span>Tags</span>,
|
||||
}));
|
||||
const setUp = (activeRoute = '/') => {
|
||||
const history = createMemoryHistory();
|
||||
history.push(activeRoute);
|
||||
|
||||
Reference in New Issue
Block a user