Files
pybricks-code/src/fileStorage/reducers.test.ts
T
David Lechner c6cf0608f4 explorer: move files state from fileStorage
This state should be exclusivly used to for displaying files in the
explorer, so the state should be in the explorer branch of the
reducer tree.
2022-04-04 18:59:13 -05:00

24 lines
597 B
TypeScript

// SPDX-License-Identifier: MIT
// Copyright (c) 2022 The Pybricks Authors
import { AnyAction } from 'redux';
import { fileStorageDidInitialize } from './actions';
import reducers from './reducers';
type State = ReturnType<typeof reducers>;
test('initial state', () => {
expect(reducers(undefined, {} as AnyAction)).toMatchInlineSnapshot(`
Object {
"isInitialized": false,
}
`);
});
test('isInitialized', () => {
expect(
reducers({ isInitialized: false } as State, fileStorageDidInitialize([]))
.isInitialized,
).toBeTruthy();
});