Files
flipper/src/reducers/__tests__/connections.node.tsx
Pritesh Nandgaonkar 47a55b0f26 Migrate BaseDevice from js to tsx
Summary: As per the title

Reviewed By: passy

Differential Revision: D16687261

fbshipit-source-id: a9d85424fb0a08fada7edd0355c356907518d366
2019-08-09 06:56:54 -07:00

28 lines
765 B
TypeScript

/**
* 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 {State} from '../connections';
import BaseDevice from '../../devices/BaseDevice';
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');
});