mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-21 00:05:49 +02:00
12 lines
726 B
TypeScript
12 lines
726 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { assertEnvironmentSelectionForCompany } from "../services/environment-selection.js";
|
|
|
|
describe("computer environment selection", () => {
|
|
const environment = { id: "environment", driver: "computer", status: "active", config: {}, metadata: { computerCompanyId: "owner" } };
|
|
const service = { getById: async () => environment };
|
|
it("permits the attached company and rejects another company", async () => {
|
|
await expect(assertEnvironmentSelectionForCompany(service, "owner", "environment")).resolves.toBeUndefined();
|
|
await expect(assertEnvironmentSelectionForCompany(service, "other", "environment")).rejects.toThrow("not available in this company");
|
|
});
|
|
});
|