reducer.test.ts 998 B

123456789101112131415161718192021222324
  1. import { reducerTester } from '../../../../test/core/redux/reducerTester';
  2. import { textboxBuilder } from '../shared/testing/builders';
  3. import { initialVariableInspectState, initInspect, variableInspectReducer, VariableInspectState } from './reducer';
  4. describe('variableInspectReducer', () => {
  5. describe('when initInspect is dispatched', () => {
  6. it('then state should be correct', () => {
  7. const variable = textboxBuilder().withId('text').withName('text').build();
  8. reducerTester<VariableInspectState>()
  9. .givenReducer(variableInspectReducer, { ...initialVariableInspectState })
  10. .whenActionIsDispatched(
  11. initInspect({
  12. usagesNetwork: [{ edges: [], nodes: [], showGraph: true, variable }],
  13. usages: [{ variable, tree: {} }],
  14. })
  15. )
  16. .thenStateShouldEqual({
  17. usagesNetwork: [{ edges: [], nodes: [], showGraph: true, variable }],
  18. usages: [{ variable, tree: {} }],
  19. });
  20. });
  21. });
  22. });