-
Notifications
You must be signed in to change notification settings - Fork 62
draft #349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
draft #349
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1016,6 +1016,45 @@ jobs: | |
| }); | ||
| }); | ||
|
|
||
| describe("permissions workflows completion", () => { | ||
| it("includes workflows in top-level permissions", async () => { | ||
| const input = `on: push | ||
| permissions: | ||
| |`; | ||
| const result = await complete(...getPositionFromCursor(input)); | ||
|
|
||
| expect(result).not.toBeUndefined(); | ||
| const labels = result.map(x => x.label); | ||
| expect(labels).toContain("workflows"); | ||
| }); | ||
|
|
||
| it("offers only write and none for workflows", async () => { | ||
| const input = `on: push | ||
| permissions: | ||
| workflows: |`; | ||
| const result = await complete(...getPositionFromCursor(input)); | ||
|
|
||
| expect(result).not.toBeUndefined(); | ||
| const labels = result.map(x => x.label); | ||
| expect(labels).toContain("write"); | ||
| expect(labels).not.toContain("read"); | ||
| }); | ||
|
|
||
| it("includes workflows in job-level permissions", async () => { | ||
| const input = `on: push | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| |`; | ||
| const result = await complete(...getPositionFromCursor(input)); | ||
|
|
||
| expect(result).not.toBeUndefined(); | ||
| const labels = result.map(x => x.label); | ||
| expect(labels).toContain("workflows"); | ||
| }); | ||
| }); | ||
|
Comment on lines
+1019
to
+1056
|
||
|
|
||
| describe("service container command/entrypoint completion", () => { | ||
| it("suggests entrypoint and command in service container", async () => { | ||
| const input = `on: push | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test name says it "offers only write and none" for
workflows, but the assertions only check forwriteand absence ofread. Add an assertion thatnoneis offered (and consider asserting no other values are present) so the test matches its intent and guards thepermission-level-write-or-no-accessbehavior.