Update tests for updated schema

This commit is contained in:
Christopher Schleiden
2023-01-13 12:32:08 -08:00
parent 5a4b6219ff
commit 27b50dfb53
4 changed files with 11 additions and 17 deletions
+4 -6
View File
@@ -312,7 +312,7 @@ jobs:
// Includes detail when available. Using continue-on-error as a sample here.
expect(result.map(x => (x.documentation as MarkupContent)?.value)).toContain(
"Prevents a job from failing when a step fails. Set to true to allow a job to pass when this step fails."
"Prevents a job from failing when a step fails. Set to `true` to allow a job to pass when this step fails."
);
});
@@ -337,9 +337,7 @@ o|
const result = await complete(...getPositionFromCursor(input));
const onResult = result.find(x => x.label === "on");
expect(onResult).not.toBeUndefined();
expect((onResult!.documentation as MarkupContent).value).toEqual(
"The name of the GitHub event that triggers the workflow. You can provide a single event string, array of events, array of event types, or an event configuration map that schedules a workflow or restricts the execution of a workflow to specific files, tags, or branch changes. For a list of available events, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows."
);
expect((onResult!.documentation as MarkupContent).value).toContain("The GitHub event that triggers the workflow.");
});
it("event list includes descriptions when available ", async () => {
@@ -348,8 +346,8 @@ o|
const result = await complete(...getPositionFromCursor(input));
const dispatchResult = result.find(x => x.label === "workflow_dispatch");
expect(dispatchResult).not.toBeUndefined();
expect((dispatchResult!.documentation as MarkupContent).value).toEqual(
"You can now create workflows that are manually triggered with the new workflow_dispatch event. You will then see a 'Run workflow' button on the Actions tab, enabling you to easily trigger a run."
expect((dispatchResult!.documentation as MarkupContent).value).toContain(
"The `workflow_dispatch` event allows you to manually trigger a workflow run."
);
});
+3 -5
View File
@@ -9,9 +9,7 @@ jobs:
runs-on: [self-hosted]`;
const result = await hover(...getPositionFromCursor(input));
expect(result).not.toBeUndefined();
expect(result?.contents).toEqual(
"The name of the GitHub event that triggers the workflow. You can provide a single event string, array of events, array of event types, or an event configuration map that schedules a workflow or restricts the execution of a workflow to specific files, tags, or branch changes. For a list of available events, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows."
);
expect(result?.contents).toContain("The GitHub event that triggers the workflow.");
});
it("on a value", async () => {
@@ -44,8 +42,8 @@ jobs:
pe|rmissions: read-all`;
const result = await hover(...getPositionFromCursor(input));
expect(result).not.toBeUndefined();
expect(result?.contents).toEqual(
"You can modify the default permissions granted to the GITHUB_TOKEN, adding or removing access as required, so that you only allow the minimum required access."
expect(result?.contents).toContain(
"You can use `permissions` to modify the default permissions granted to the `GITHUB_TOKEN`"
);
});
+2 -4
View File
@@ -92,16 +92,14 @@ jobs:
case "name": {
const nameKey = pair.key.assertString("name");
expect(nameKey.definition).not.toBeUndefined();
expect(nameKey.description).toBe("The name of the workflow.");
expect(nameKey.description).toContain("The name of the workflow");
break;
}
case "on": {
const onKey = pair.key.assertString("on");
const onValue = pair.value.assertString("push");
expect(onKey.definition).not.toBeUndefined();
expect(onKey.description).toBe(
"The name of the GitHub event that triggers the workflow. You can provide a single event string, array of events, array of event types, or an event configuration map that schedules a workflow or restricts the execution of a workflow to specific files, tags, or branch changes. For a list of available events, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows."
);
expect(onKey.description).toContain("The GitHub event that triggers the workflow.");
expect(onValue.definition).not.toBeUndefined();
expect(onValue.description).toBe("Runs your workflow when you push a commit or tag.");
break;
@@ -85,7 +85,7 @@ on:
types:
- created
- closed
- opened
- reopened
- edited
- deleted
project_card:
@@ -327,7 +327,7 @@ jobs:
"types": [
"created",
"closed",
"opened",
"reopened",
"edited",
"deleted"
]