File size: 921 Bytes
34810d2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | import { describe, expect, expectTypeOf, it } from "vitest";
import type { ModelPickerCapabilityProfile } from "./capabilities.js";
describe("ModelPickerCapabilityProfile", () => {
it("keeps presentation, callback units, and response mechanics distinct", () => {
const profile = {
presentation: {
supported: true,
buttons: true,
selects: true,
limits: { actions: { maxActions: 8 } },
},
callback: { limit: 64, unit: "utf8-bytes" },
response: {
supportsEphemeral: false,
supportsEdit: true,
supportsReplace: true,
},
} satisfies ModelPickerCapabilityProfile;
expect(profile.callback).toEqual({ limit: 64, unit: "utf8-bytes" });
expect(profile.response.supportsEdit).toBe(true);
expectTypeOf<ModelPickerCapabilityProfile["callback"]["unit"]>().toEqualTypeOf<
"utf8-bytes" | "utf16-units"
>();
});
});
|