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
25 changes: 25 additions & 0 deletions js-src/Builder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,31 @@ describe("Builder", () => {
expect(JSON.stringify(manifestStore)).toContain("thumbnail.ingredient");
});

it("should add ingredient with custom metadata", async () => {
const builder = Builder.new();
const ingredient = {
title: "Test Ingredient",
format: "image/jpeg",
instance_id: "ingredient-12345",
relationship: "componentOf",
metadata: {
customString: "my custom value",
customNumber: 42,
customBool: true,
customObject: {
nested: "value",
count: 123
},
customArray: ["item1", "item2", "item3"]
}
};
await builder.addIngredient(JSON.stringify(ingredient));

const definition = builder.getManifestDefinition();
expect(definition.ingredients).toHaveLength(1);
expect(definition.ingredients![0]).toMatchObject(ingredient);
});

it("should perform redaction workflow like test_redaction_async", async () => {
// This test mirrors the Rust test_redaction_async test

Expand Down
Loading