mirror of
https://github.com/grafana/grafana.git
synced 2025-02-14 17:43:35 -06:00
* Chore: Removes strict null checks in ReducerTester * Chore: Fixes strict null errors in ConfigureStore * Chore: Fixes strict null errors in reducer tests * Chore: Fixes strict null errors in reducers tests * Chore: Fixes strict null errors in reducers tests * Chore: Fixes strict null errors in toggleLogActionsMiddleware * Chore: Fixes strict null errors in navModelReducer * Core: Fixes strict null errors in public/app/features/admin/state * Chore: Fixes strict null errors in public/app/features/dashboard/state/reducers.test.ts * Chore: Fixes strict null errors in public/app/features/explore/state/reducers.test.ts * Chore: Fixes strict null errors in public/app/features/datasources/state/reducers.test.ts * Chore: Fixes strict null errors in public/e2e-test/scenarios/templating/templatevariables-crud.test.ts * Chore: Fixes strict null errors in public/app/features/dashboard/containers/DashboardPage.test.tsx
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { reducerTester } from '../../../test/core/redux/reducerTester';
|
|
import { initialState, navIndexReducer, updateNavIndex } from './navModel';
|
|
import { NavIndex } from '@grafana/data';
|
|
|
|
describe('applicationReducer', () => {
|
|
describe('when updateNavIndex is dispatched', () => {
|
|
it('then state should be correct', () => {
|
|
reducerTester<NavIndex>()
|
|
.givenReducer(navIndexReducer, { ...initialState })
|
|
.whenActionIsDispatched(
|
|
updateNavIndex({
|
|
id: 'parent',
|
|
text: 'Some Text',
|
|
children: [
|
|
{
|
|
id: 'child',
|
|
text: 'Child',
|
|
},
|
|
],
|
|
})
|
|
)
|
|
.thenStateShouldEqual({
|
|
...initialState,
|
|
child: {
|
|
id: 'child',
|
|
text: 'Child',
|
|
parentItem: {
|
|
id: 'parent',
|
|
text: 'Some Text',
|
|
children: [
|
|
{
|
|
id: 'child',
|
|
text: 'Child',
|
|
},
|
|
],
|
|
},
|
|
},
|
|
});
|
|
});
|
|
});
|
|
});
|