Versions 33 to 34
new file, 198 lines
1+// abso orgs and abso org: reads as the person who approved the box's sign-in, and the changes say where the
2+// website makes them. The server here is a stand-in that answers the org routes' documented shapes.
3+
13+
16+
31+
47+
49+
51+ it("lists yours with your role, and invitations waiting, reading with the box's sign-in", async () => {
61+ invitations: [{ id: "inv_1", org: "gamma", role: "member", expiresAt: "2026-10-16T10:00:00.000Z" }],
77+ assert.deepEqual(s.asked, [{ url: `${SERVER}/orgs`, method: "GET", auth: `Box ${CREDENTIAL}` }]);
79+
80+ it("says so when the box isn't signed in, the sign-in isn't taken, or orgs aren't on", async () => {
82+ await assert.rejects(runOrgs(SERVER, { home: empty, fetch: server({}).fetcher }), /abso login signs it in/);
84+ const expired = server({ "/orgs": { status: 401, body: { error: "missing or wrong token" } } });
85+ await assert.rejects(runOrgs(SERVER, { home, fetch: expired.fetcher }), /abso login renews it/);
86+ const off = server({ "/orgs": { status: 404, body: { error: "organizations aren't on here yet" } } });
87+ await assert.rejects(runOrgs(SERVER, { home, fetch: off.fetcher }), /api\.example\.dev: organizations aren't on/);
89+
93+ await assert.rejects(runOrgs(SERVER, { home, fetch: s.fetcher }), (e: Error) => !e.message.includes(CREDENTIAL));
96+
110+ invites: [{ id: "inv_2", role: "member", kind: "link", for: null, expiresAt: "2026-10-16T10:00:00.000Z" }],
112+
113+ it("shows its projects, people, settings and open invites to a member, never a person's id", async () => {
133+
137+ "/orgs/acme-labs": { status: 200, body: { name: "acme-labs", displayName: "Acme Labs", description: null } },
140+ assert.equal(out.text, "acme-labs (Acme Labs)\nYou aren't a member, so its people and settings aren't shown.");
142+
145+ await assert.rejects(runOrg(args(["nope"]), SERVER, { home, fetch: server({}).fetcher }), /^.*nope: no such route/);
147+
148+ it("sends no change: each says where on the website it is made, and nothing reaches the server", async () => {
152+ [["acme-labs", "--invite", "sam"], /--invite is on acme-labs's People tab: https:\/\/example\.dev\/acme-labs\./],
159+ [["new", "acme-labs", "--name", "Acme Labs"], /Make acme-labs at https:\/\/example\.dev\/orgs\/new\./],
162+ await assert.rejects(runOrg(args(line), SERVER, { home, fetch: s.fetcher }), said, line.join(" "));
163+ await assert.rejects(runOrg(args(line), SERVER, { home, fetch: s.fetcher }), /changed on the website for now/);
167+
182+
186+ assert.equal(siteOf("https://staging.example.workers.dev/"), "https://staging.example.workers.dev");
190+
195+ /made on the website for now: New project at https:\/\/example\.dev, with acme-labs as its owner/,
- MCP
- compare on this site's /mcp
- CLI
- abso diff 33 34 client/test/orgs.test.ts --json
- JSON
- /christopher/abso-core/compare/33..34?file=client%2Ftest%2Forgs.test.ts&format=json