Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@corbits/api-query": "workspace:*",
"@corbits/approvals": "workspace:*",
"@corbits/artifact-ui": "workspace:*",
"@corbits/assistant-workflow": "workspace:*",
"@corbits/bench-ui": "workspace:*",
"@corbits/chat-ui": "workspace:*",
"@corbits/client-log": "workspace:*",
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/client-bootstrap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ test("session bootstrap drives the portable client manifest", async () => {
id,
name: "Ada",
slug: "ada",
domain: "ada.example.com",
parentId: null,
});
},
Expand Down
46 changes: 46 additions & 0 deletions apps/web/src/myra-deploy.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { describe, expect, test } from "bun:test";

import { buildMyraDeployInput, MyraDeployError } from "./myra-deploy";
import { MYRA_SOURCE_CONFIG } from "./myra-source";

describe("buildMyraDeployInput", () => {
test("maps a published asset and the operator's offering pick to a WorkflowDeployInput", () => {
const input = buildMyraDeployInput({
assetId: "ast_123",
sourceOfferingIds: ["off_1", "off_2"],
defaultSourceOfferingId: "off_2",
});

expect(input).toEqual({
source: {
kind: "asset",
assetId: "ast_123",
package: { format: "tarball" },
},
entry: MYRA_SOURCE_CONFIG.entryPath,
sourceOfferingIds: ["off_1", "off_2"],
defaultSourceOfferingId: "off_2",
pin: `${MYRA_SOURCE_CONFIG.packageName}@${MYRA_SOURCE_CONFIG.packageVersion}`,
});
});

test("rejects an empty offering list", () => {
expect(() =>
buildMyraDeployInput({
assetId: "ast_123",
sourceOfferingIds: [],
defaultSourceOfferingId: "off_1",
}),
).toThrow(MyraDeployError);
});

test("rejects a default offering id absent from the offering list", () => {
expect(() =>
buildMyraDeployInput({
assetId: "ast_123",
sourceOfferingIds: ["off_1"],
defaultSourceOfferingId: "off_2",
}),
).toThrow(MyraDeployError);
});
});
Loading
Loading