refactor: extract execution permission policy
This commit is contained in:
@@ -12,6 +12,7 @@ let createIndependentGroupChat: (typeof import("../src/lib/boss-data"))["createI
|
||||
let readState: (typeof import("../src/lib/boss-data"))["readState"];
|
||||
let writeState: (typeof import("../src/lib/boss-data"))["writeState"];
|
||||
let AUTH_SESSION_COOKIE: string;
|
||||
let baseState: Awaited<ReturnType<typeof import("../src/lib/boss-data")["readState"]>>;
|
||||
|
||||
async function setup() {
|
||||
if (runtimeRoot) {
|
||||
@@ -33,6 +34,7 @@ async function setup() {
|
||||
createIndependentGroupChat = data.createIndependentGroupChat;
|
||||
readState = data.readState;
|
||||
writeState = data.writeState;
|
||||
baseState = structuredClone(await readState());
|
||||
AUTH_SESSION_COOKIE = auth.AUTH_SESSION_COOKIE;
|
||||
}
|
||||
|
||||
@@ -42,6 +44,11 @@ test.after(async () => {
|
||||
}
|
||||
});
|
||||
|
||||
test.beforeEach(async () => {
|
||||
await setup();
|
||||
await writeState(structuredClone(baseState));
|
||||
});
|
||||
|
||||
async function createAuthedRequest(projectId: string, body: { body: string; kind?: string }) {
|
||||
const session = await createAuthSession({
|
||||
account: "17600003315",
|
||||
|
||||
Reference in New Issue
Block a user