mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-19 13:06:22 +00:00
First refactor of redux tests to avoid covering RTK implementation details
This commit is contained in:
@@ -3,22 +3,10 @@ import { sidebarNotPresent, sidebarPresent, sidebarReducer } from '../../../src/
|
||||
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() });
|
||||
[sidebarPresent, { sidebarPresent: true }],
|
||||
[sidebarNotPresent, { sidebarPresent: false }],
|
||||
])('returns expected on %s', (actionCreator, expected) => {
|
||||
expect(sidebarReducer(undefined, actionCreator())).toEqual(expected);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user