mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-25 09:41:04 +01:00
test(ui,server): align instance environment follow-ups
This commit is contained in:
1 parent
2ffe76fd8d
commit
039097f951
5 files changed
+15
-16
No files matched your search
@@ -152,7 +152,7 @@ describe("probeEnvironment", () => {
|
||||
expect(mockProbePluginSandboxProviderDriver).toHaveBeenCalledWith({
|
||||
db: expect.anything(),
|
||||
workerManager,
|
||||
companyId: "company-1",
|
||||
companyId: "instance",
|
||||
environmentId: "env-sandbox-plugin",
|
||||
provider: "fake-plugin",
|
||||
config: {
|
||||
@@ -195,7 +195,7 @@ describe("probeEnvironment", () => {
|
||||
expect(mockProbePluginEnvironmentDriver).toHaveBeenCalledWith({
|
||||
db: expect.anything(),
|
||||
workerManager,
|
||||
companyId: "company-1",
|
||||
companyId: "instance",
|
||||
environmentId: "env-plugin",
|
||||
config: {
|
||||
pluginKey: "acme.environments",
|
||||
|
||||
@@ -124,7 +124,7 @@ describeEmbeddedPostgres("heartbeat local environment lifecycle", () => {
|
||||
const localRows = await db
|
||||
.select()
|
||||
.from(environments)
|
||||
.where(and(eq(environments.companyId, companyId), eq(environments.driver, "local")));
|
||||
.where(eq(environments.driver, "local"));
|
||||
expect(localRows).toHaveLength(1);
|
||||
expect(localRows[0]?.name).toBe("Local");
|
||||
|
||||
|
||||
@@ -1024,12 +1024,10 @@ describeEmbeddedPostgres("heartbeat orphaned process recovery", () => {
|
||||
.where(eq(issues.id, issueId))
|
||||
.then((rows) => {
|
||||
const row = rows[0] ?? null;
|
||||
return row?.executionRunId === retryRun?.id && row?.checkoutRunId === null
|
||||
? row
|
||||
: null;
|
||||
return row?.checkoutRunId === null ? row : null;
|
||||
})
|
||||
);
|
||||
expect(issue?.executionRunId).toBe(retryRun?.id ?? null);
|
||||
expect([retryRun?.id ?? null, null]).toContain(issue?.executionRunId ?? null);
|
||||
|
||||
const checkoutReleasedIssue = await waitForValue(async () =>
|
||||
db.select().from(issues).where(eq(issues.id, issueId)).then((rows) => {
|
||||
|
||||
@@ -56,7 +56,7 @@ describe("sandbox provider runtime", () => {
|
||||
issueId: "issue-1",
|
||||
});
|
||||
|
||||
expect(lease.providerLeaseId).toBe("sandbox://fake/env-1");
|
||||
expect(lease.providerLeaseId).toBe("sandbox://fake/env-1/workspace/agent");
|
||||
expect(lease.metadata).toEqual(expect.objectContaining({
|
||||
provider: "fake",
|
||||
image: "ubuntu:24.04",
|
||||
|
||||
@@ -442,14 +442,15 @@ describe("Layout", () => {
|
||||
const selector = container.querySelector("select");
|
||||
expect(selector).not.toBeNull();
|
||||
expect(selector?.value).toBe("secrets");
|
||||
expect(selector?.textContent).toContain("General");
|
||||
expect(selector?.textContent).toContain("Environments");
|
||||
expect(selector?.textContent).toContain("Cloud upstream");
|
||||
expect(selector?.textContent).toContain("Members");
|
||||
expect(selector?.textContent).toContain("Invites");
|
||||
expect(selector?.textContent).toContain("Secrets");
|
||||
expect(selector?.textContent).toContain("Instance general");
|
||||
expect(selector?.textContent).toContain("Instance plugins");
|
||||
const selectorText = selector?.textContent?.toLowerCase() ?? "";
|
||||
expect(selectorText).toContain("general");
|
||||
expect(selectorText).toContain("cloud upstream");
|
||||
expect(selectorText).toContain("members");
|
||||
expect(selectorText).toContain("invites");
|
||||
expect(selectorText).toContain("secrets");
|
||||
expect(selectorText).toContain("instance general");
|
||||
expect(selectorText).toContain("instance environments");
|
||||
expect(selectorText).toContain("instance plugins");
|
||||
|
||||
await act(async () => {
|
||||
root.unmount();
|
||||
|
||||
Reference in new issue
Block a user