refactor(catalog): unify commands and embed guarded catalog workspace
This commit is contained in:
1 parent
16f35568f5
commit
193b6686a9
57 files changed
+3268
-728
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { parseCatalogSearch, validSearchQuery } from "./search";
|
||||
|
||||
describe("catalog search input", () => {
|
||||
it("allows a one digit ID but requires at least two text characters", () => {
|
||||
expect(validSearchQuery("7")).toBe(true);
|
||||
expect(validSearchQuery("a")).toBe(false);
|
||||
expect(validSearchQuery(" ab ")).toBe(true);
|
||||
});
|
||||
it("does not round oversized numeric identifiers", () => {
|
||||
expect(parseCatalogSearch("normal", "9007199254740992").numericId).toBe(
|
||||
null,
|
||||
);
|
||||
});
|
||||
it("escapes LIKE wildcard and escape characters", () => {
|
||||
expect(parseCatalogSearch("bc", "a_%=").pattern).toBe("a=_=%==%");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user