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.

606 B
Raw Blame
import { describe, expect, it } from "vite-plus/test";
import { parseMultiselect } from "./parse-multiselect";

describe("parseMultiselect", () => {
  it("reads JSON arrays", () => {
    expect(parseMultiselect('["Web","iOS"]')).toEqual(["Web", "iOS"]);
  });

  it("falls back to comma separated values", () => {
    expect(parseMultiselect("Web, iOS,")).toEqual(["Web", "iOS"]);
  });

  it("returns nothing for empty or non-array input", () => {
    expect(parseMultiselect("")).toEqual([]);
    expect(parseMultiselect(null)).toEqual([]);
    expect(parseMultiselect('{"a":1}')).toEqual([]);
  });
});