fix: browser fill default type parity (#27662) (thanks @Uface11)
This commit is contained in:
16
src/cli/browser-cli-actions-input/shared.test.ts
Normal file
16
src/cli/browser-cli-actions-input/shared.test.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { readFields } from "./shared.js";
|
||||
|
||||
describe("readFields", () => {
|
||||
it("defaults missing type to text", async () => {
|
||||
await expect(readFields({ fields: '[{"ref":"7","value":"world"}]' })).resolves.toEqual([
|
||||
{ ref: "7", type: "text", value: "world" },
|
||||
]);
|
||||
});
|
||||
|
||||
it("requires ref", async () => {
|
||||
await expect(readFields({ fields: '[{"type":"textbox","value":"world"}]' })).rejects.toThrow(
|
||||
"fields[0] must include ref",
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user