Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

AzureDevOpsPullRequestProvider.test.ts

29 lines1.2 KB

1import { describe, expect, it } from "vite-plus/test";
2​
3import { AZURE_DEVOPS_VIEWER_PERMISSIONS } from "./AzureDevOpsPullRequestProvider.ts";
4​
5describe("azure devops viewer permissions", () => {
6 it("offers every action to whoever is signed in, because Azure names no permission", () => {
7 // The same answer for a viewer who can write, one who can only read, and an author with read
8 // access: `az repos pr show` and `az repos pr list` carry nothing about the caller's standing,
9 // and an unknown permission is granted rather than guessed away. Azure refuses the ones it
10 // will not allow, at the moment they are taken, in words this could not have written.
11 expect(AZURE_DEVOPS_VIEWER_PERMISSIONS).toEqual({
12 actions: [
13 "merge",
14 "ready",
15 "draft",
16 "close",
17 "reopen",
18 "enable-auto-merge",
19 "disable-auto-merge",
20 ],
21 // False because the host itself cannot post one, not because this viewer may not.
22 comment: false,
23 resolve: false,
24 verdicts: [],
25 // True because `az repos pr reviewer` does take one, and Azure says nothing about who may.
26 requestReviewers: true,
27 });
28 });
29});