stavalfi / jstream

Represent graphs, differently https://stavalfi.github.io/jstream/
2 stars 0 forks source link

bug when flow name contains the symbol: '_' in a graph #37

Closed stavalfi closed 5 years ago

stavalfi commented 5 years ago

test to reproduce:


test('5', () => {
  const flowsConfig = graph => ({
    splitters: {
      extends: '/',
    },
    flows: graph,
  });

  const actual = [
    {
      name: 'flow0',
      graph: ['a:completed_download'],
      default_flow_name: 'complete_download',
    },
    {
      name: 'flow1',
      graph: 'flow0',
    },
  ];

  const expected = [
    {
      name: 'a',
      graph: [{a: [[], []]}],
      defaultNodeIndex: 0,
    },
    {
      name: 'completed_download',
      graph: [{completed_download: [[], []]}],
      defaultNodeIndex: 0,
    },
    {
      name: 'flow0',
      graph: [{'flow0/a': [[], [1]]}, {'flow0/completed_download': [[0], []]}],
      defaultNodeIndex: 1,
    },
    {
      name: 'flow1',
      graph: [{'flow1/flow0/a': [[], [1]]}, {'flow1/flow0/completed_download': [[0], []]}],
      defaultNodeIndex: 1,
    },
  ];

  const actualFlows = createFlows(actual, flowsConfig);
  const expectedFlows = createExpected(expected, flowsConfig(actual));

  assertEqualFlows(expectedFlows, actualFlows);
});
stavalfi commented 5 years ago

there is a typo in the test: complete_download instead of completed_download