Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions packages/core/sdk/src/policies.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,23 @@ describe("executor.policies", () => {
}),
);

it.live("concurrent creates of equally specific rules get distinct positions", () =>
Effect.gen(function* () {
const executor = yield* setupExecutor();
yield* Effect.all(
[
executor.policies.create({ owner: "org", pattern: "vercel.dns.create", action: "block" }),
executor.policies.create({ owner: "org", pattern: "vercel.dns.delete", action: "block" }),
],
{ concurrency: "unbounded" },
);

const rules = yield* executor.policies.list();
expect(rules).toHaveLength(2);
expect(new Set(rules.map((r) => r.position)).size).toBe(2);
}),
);

it.effect("create stores rules at the requested owner", () =>
Effect.gen(function* () {
const executor = yield* setupExecutor();
Expand Down
Loading