Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

test(custom-fields): preserve hidden options in resolver fixtures

tinsever503a1e5977b2
diff --git a/tests/api/custom-field/resolve-field-update.test.ts b/tests/api/custom-field/resolve-field-update.test.ts
index b463728dd..ee33303ee 100644
--- a/tests/api/custom-field/resolve-field-update.test.ts
+++ b/tests/api/custom-field/resolve-field-update.test.ts
@@ -10,6 +10,7 @@ const dropdown: CurrentCustomField = {
required: false,
defaultValue: "Medium",
options: ["Small", "Medium", "Large"],
+ hiddenOptions: [],
};
describe("resolveFieldUpdate", () => {
@@ -21,6 +22,16 @@ describe("resolveFieldUpdate", () => {
});
});
+ it("preserves hidden options when editing unrelated fields", () => {
+ const field = { ...dropdown, hiddenOptions: ["Large"] };
+
+ expect(resolveFieldUpdate(field, { name: " T-shirt size " })).toEqual({
+ ...field,
+ name: "T-shirt size",
+ removedOptions: [],
+ });
+ });
+
it("rejects type changes other than dropdown and multiselect", () => {
expect(() =>
resolveFieldUpdate(