Skip to content

Commit

Permalink
Add more tests for format2 symbol provider
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Jun 14, 2024
1 parent 8fdaf4d commit 459d3e6
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,27 @@ describe("Format2 Workflow Symbols Provider", () => {
expect(symbols[1].name).toBe("Test 2");
expect(symbols[2].name).toBe("Test 3");
});

it("should return symbols for each test", () => {
const content = `
- doc: a test
job:
input_1:
class: File
path: a
input 2: b
'input:3': c`;
const symbols = getSymbols(content);
expect(symbols.length).toBe(1);
const testSymbol = symbols[0];
expect(testSymbol.name).toBe("Test 1");
expect(testSymbol.children?.length).toBe(2);
expect(testSymbol.children?.at(0)?.name).toBe("doc");
const jobSymbol = testSymbol.children?.at(1);
expect(jobSymbol?.name).toBe("job");
expect(jobSymbol?.children?.length).toBe(3);
expect(jobSymbol?.children?.at(0)?.name).toBe("input_1");
expect(jobSymbol?.children?.at(1)?.name).toBe("input 2");
expect(jobSymbol?.children?.at(2)?.name).toBe("input:3");
});
});

0 comments on commit 459d3e6

Please sign in to comment.