shlink-web-client/test/common/reducer/sidebar.test.ts

25 lines
805 B
TypeScript
Raw Normal View History

2023-02-18 13:11:01 +03:00
import { sidebarNotPresent, sidebarPresent, sidebarReducer } from '../../../src/common/reducers/sidebar';
2022-03-11 18:12:54 +03:00
describe('sidebarReducer', () => {
describe('reducer', () => {
it.each([
2022-11-04 21:45:03 +03:00
[sidebarPresent.toString(), { sidebarPresent: true }],
[sidebarNotPresent.toString(), { sidebarPresent: false }],
2022-03-11 18:12:54 +03:00
])('returns expected on %s', (type, expected) => {
2022-11-04 21:45:03 +03:00
expect(sidebarReducer(undefined, { type })).toEqual(expected);
2022-03-11 18:12:54 +03:00
});
});
describe('sidebarPresent', () => {
it('returns expected action', () => {
2022-11-04 21:45:03 +03:00
expect(sidebarPresent()).toEqual({ type: sidebarPresent.toString() });
2022-03-11 18:12:54 +03:00
});
});
describe('sidebarNotPresent', () => {
it('returns expected action', () => {
2022-11-04 21:45:03 +03:00
expect(sidebarNotPresent()).toEqual({ type: sidebarNotPresent.toString() });
2022-03-11 18:12:54 +03:00
});
});
});