shlink-web-client/test/common/reducer/sidebar.test.ts
2022-11-04 19:45:03 +01:00

24 lines
805 B
TypeScript

import { sidebarReducer, sidebarNotPresent, sidebarPresent } from '../../../src/common/reducers/sidebar';
describe('sidebarReducer', () => {
describe('reducer', () => {
it.each([
[sidebarPresent.toString(), { sidebarPresent: true }],
[sidebarNotPresent.toString(), { sidebarPresent: false }],
])('returns expected on %s', (type, expected) => {
expect(sidebarReducer(undefined, { type })).toEqual(expected);
});
});
describe('sidebarPresent', () => {
it('returns expected action', () => {
expect(sidebarPresent()).toEqual({ type: sidebarPresent.toString() });
});
});
describe('sidebarNotPresent', () => {
it('returns expected action', () => {
expect(sidebarNotPresent()).toEqual({ type: sidebarNotPresent.toString() });
});
});
});