Add field_added and field_removed issue event types to workflows (#351)

This commit is contained in:
Armağan
2026-04-16 10:55:56 -05:00
committed by GitHub
parent 8aa246e9d9
commit 9a8a94bd21
4 changed files with 59 additions and 3 deletions
+13
View File
@@ -112,6 +112,19 @@ jobs:
]);
});
it("issues activity type completion includes field_added and field_removed", async () => {
const input = `on:
issues:
types:
- |`;
const result = await complete(...getPositionFromCursor(input));
const labels = result.map(x => x.label);
expect(labels).toContain("field_added");
expect(labels).toContain("field_removed");
expect(labels).toContain("opened");
expect(labels).toContain("closed");
});
it("map keys filter out existing values", async () => {
const input = `on: push
jobs:
+37
View File
@@ -165,6 +165,43 @@ jobs:
} as Diagnostic);
});
it("issues event with field_added activity type", async () => {
const result = await validate(
createDocument(
"wf.yaml",
`on:
issues:
types: [field_added, field_removed]
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo`
)
);
expect(result.length).toBe(0);
});
it("issues event with invalid activity type", async () => {
const result = await validate(
createDocument(
"wf.yaml",
`on:
issues:
types: [opened, not_a_real_type]
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo`
)
);
expect(result.length).toBe(1);
expect(result[0]?.message).toBe("Unexpected value 'not_a_real_type'");
});
it("invalid cron string", async () => {
const result = await validate(
createDocument(