mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-12 18:43:50 +00:00
Created sidebar reducer test
This commit is contained in:
31
test/common/reducer/sidebar.test.ts
Normal file
31
test/common/reducer/sidebar.test.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
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 });
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user