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

AzureDevOpsPullRequestProvider.test.ts

21 lines1.1 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: ["merge", "ready", "draft", "close", "reopen"],
13 // False because the host itself cannot post one, not because this viewer may not.
14 comment: false,
15 resolve: false,
16 verdicts: [],
17 // True because `az repos pr reviewer` does take one, and Azure says nothing about who may.
18 requestReviewers: true,
19 });
20 });
21});