migrate redux store
Summary: Migrating redux stores to TypeScript Reviewed By: passy Differential Revision: D16579796 fbshipit-source-id: e3e507f17f1bdd57eb45e30cb0b28aaee6c4521c
This commit is contained in:
committed by
Facebook Github Bot
parent
2c95ef6b25
commit
64cefd0f84
27
src/reducers/__tests__/connections.node.tsx
Normal file
27
src/reducers/__tests__/connections.node.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Copyright 2018-present Facebook.
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
* @format
|
||||
*/
|
||||
|
||||
import reducer from '../connections';
|
||||
import BaseDevice from '../../devices/BaseDevice';
|
||||
import {State} from '../connections';
|
||||
|
||||
test('REGISTER_DEVICE doesnt remove error', () => {
|
||||
const initialState: State = reducer(undefined, {
|
||||
type: 'SERVER_ERROR',
|
||||
payload: 'something went wrong',
|
||||
});
|
||||
|
||||
// Precondition
|
||||
expect(initialState.error).toEqual('something went wrong');
|
||||
|
||||
const endState = reducer(initialState, {
|
||||
type: 'REGISTER_DEVICE',
|
||||
payload: new BaseDevice('serial', 'physical', 'title'),
|
||||
});
|
||||
|
||||
expect(endState.error).toEqual('something went wrong');
|
||||
});
|
||||
Reference in New Issue
Block a user