mirror of
https://github.com/grafana/grafana.git
synced 2025-09-22 10:32:49 +08:00

* Chore: reduces misc reducerTester strict issues * Chore: fixes various strict errors in reducer tests for ElasticSearch * Chore: lowers errors in AzureMonitor DataSource tests
30 lines
1.3 KiB
TypeScript
30 lines
1.3 KiB
TypeScript
import { reducerTester } from '../../../../test/core/redux/reducerTester';
|
|
import { initialVariableInspectState, initInspect, variableInspectReducer, VariableInspectState } from './reducer';
|
|
import { textboxBuilder } from '../shared/testing/builders';
|
|
|
|
describe('variableInspectReducer', () => {
|
|
describe('when initInspect is dispatched', () => {
|
|
it('then state should be correct', () => {
|
|
const variable = textboxBuilder().withId('text').withName('text').build();
|
|
reducerTester<VariableInspectState>()
|
|
.givenReducer(variableInspectReducer, { ...initialVariableInspectState })
|
|
.whenActionIsDispatched(
|
|
initInspect({
|
|
unknownExits: true,
|
|
unknownsNetwork: [{ edges: [], nodes: [], showGraph: true, variable }],
|
|
usagesNetwork: [{ edges: [], nodes: [], showGraph: true, variable }],
|
|
usages: [{ variable, tree: {} }],
|
|
unknown: [{ variable, tree: {} }],
|
|
})
|
|
)
|
|
.thenStateShouldEqual({
|
|
unknownExits: true,
|
|
unknownsNetwork: [{ edges: [], nodes: [], showGraph: true, variable }],
|
|
usagesNetwork: [{ edges: [], nodes: [], showGraph: true, variable }],
|
|
usages: [{ variable, tree: {} }],
|
|
unknown: [{ variable, tree: {} }],
|
|
});
|
|
});
|
|
});
|
|
});
|