mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 14:45:24 +00:00
feat: harden plugin api for separate repos, signed updates and generic external login
This commit is contained in:
1 parent
fb9c168b6b
commit
80944301dd
310 files changed
+6577
-4927
No files matched your search
@@ -45,12 +45,12 @@ describe("snippets activate", () => {
|
||||
const service = server.mock.services.get("snippets.access") as {
|
||||
list: () => Promise<unknown>;
|
||||
};
|
||||
const listed = await server.mock.ctx.asUser("user-1", () => service.list());
|
||||
const listed = await server.mock.actAs("user-1", () => service.list());
|
||||
expect(listed).toEqual([
|
||||
expect.objectContaining({ name: "Deploy", content: "echo deploy" }),
|
||||
]);
|
||||
|
||||
const otherUsersList = await server.mock.ctx.asUser("user-2", () =>
|
||||
const otherUsersList = await server.mock.actAs("user-2", () =>
|
||||
service.list(),
|
||||
);
|
||||
expect(otherUsersList).toEqual([]);
|
||||
@@ -64,7 +64,7 @@ describe("snippets activate", () => {
|
||||
remove: (id: number) => Promise<unknown>;
|
||||
};
|
||||
const asUser = <T>(fn: () => Promise<T>) =>
|
||||
server!.mock.ctx.asUser("user-1", fn);
|
||||
server!.mock.actAs("user-1", fn);
|
||||
|
||||
await expect(
|
||||
asUser(() => service.create({ name: "x", content: "ls" })),
|
||||
|
||||
Reference in new issue
Block a user