Skip to content

Commit

Permalink
Add validation tests for format2 primitive types
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Jun 21, 2024
1 parent 7591b4f commit 8b1f543
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions server/gx-workflow-ls-format2/tests/integration/validation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,37 @@ steps:
);
});

it("should not report error for compatible primitive types", async () => {
const content = `
class: GalaxyWorkflow
inputs:
outputs:
steps:
step:
position:
top: 0
left: 0
`;
const diagnostics = await validateDocument(content);
expect(diagnostics).toHaveLength(0);
});

it("should report error for incompatible primitive types", async () => {
const content = `
class: GalaxyWorkflow
inputs:
outputs:
steps:
step:
position:
top: "not a number"
left: 0
`;
const diagnostics = await validateDocument(content);
expect(diagnostics).toHaveLength(1);
expect(diagnostics[0].message).toContain("Type mismatch for field 'top'. Expected 'float' but found 'string'.");
});

describe("Custom Rules", () => {
let rule: ValidationRule;

Expand Down

0 comments on commit 8b1f543

Please sign in to comment.