mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-24 01:48:18 +03:00
31 lines
856 B
TypeScript
31 lines
856 B
TypeScript
import { Mock } from 'ts-mockery';
|
|
import reducer, {
|
|
Sidebar,
|
|
SIDEBAR_NOT_PRESENT,
|
|
SIDEBAR_PRESENT,
|
|
sidebarNotPresent,
|
|
sidebarPresent,
|
|
} from '../../../src/common/reducers/sidebar';
|
|
|
|
describe('sidebarReducer', () => {
|
|
describe('reducer', () => {
|
|
it.each([
|
|
[SIDEBAR_PRESENT, { sidebarPresent: true }],
|
|
[SIDEBAR_NOT_PRESENT, { sidebarPresent: false }],
|
|
])('returns expected on %s', (type, expected) => {
|
|
expect(reducer(Mock.all<Sidebar>(), { type })).toEqual(expected);
|
|
});
|
|
});
|
|
|
|
describe('sidebarPresent', () => {
|
|
it('returns expected action', () => {
|
|
expect(sidebarPresent()).toEqual({ type: SIDEBAR_PRESENT });
|
|
});
|
|
});
|
|
|
|
describe('sidebarNotPresent', () => {
|
|
it('returns expected action', () => {
|
|
expect(sidebarNotPresent()).toEqual({ type: SIDEBAR_NOT_PRESENT });
|
|
});
|
|
});
|
|
});
|