mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
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.
24 lines
597 B
TypeScript
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();
|
|
});
|