shlink-web-client/test/app/reducers/appUpdates.test.ts

26 lines
862 B
TypeScript
Raw Normal View History

2022-11-04 21:39:15 +03:00
import { appUpdatesReducer, appUpdateAvailable, resetAppUpdate } from '../../../src/app/reducers/appUpdates';
2021-06-06 19:49:38 +03:00
describe('appUpdatesReducer', () => {
describe('reducer', () => {
it('returns true on APP_UPDATE_AVAILABLE', () => {
2022-11-04 21:39:15 +03:00
expect(appUpdatesReducer(undefined, { type: appUpdateAvailable.toString() })).toEqual(true);
2021-06-06 19:49:38 +03:00
});
it('returns false on RESET_APP_UPDATE', () => {
2022-11-04 21:39:15 +03:00
expect(appUpdatesReducer(undefined, { type: resetAppUpdate.toString() })).toEqual(false);
2021-06-06 19:49:38 +03:00
});
});
describe('appUpdateAvailable', () => {
it('creates expected action', () => {
2022-11-04 21:39:15 +03:00
expect(appUpdateAvailable()).toEqual({ type: appUpdateAvailable.toString() });
2021-06-06 19:49:38 +03:00
});
});
describe('resetAppUpdate', () => {
it('creates expected action', () => {
2022-11-04 21:39:15 +03:00
expect(resetAppUpdate()).toEqual({ type: resetAppUpdate.toString() });
2021-06-06 19:49:38 +03:00
});
});
});