1 parent
f621e40655
commit
e2fa810f2e
16 files changed
+146
-10
No files matched your search
@@ -36,6 +36,19 @@ describe("normalizeColumnFormatter", () => {
|
||||
expect(normalizeColumnFormatter({ ...base, filter: { column: "dict_type", mode: "between", value: "A" } })).toBeUndefined();
|
||||
expect(normalizeColumnFormatter({ ...base, filter: { column: "dict_type", mode: "raw-sql", value: "1=1" } })).toBeUndefined();
|
||||
});
|
||||
|
||||
it.each(["is-blank", "is-not-blank"] as const)("preserves the value-less %s manual reference filter", (mode) => {
|
||||
expect(
|
||||
normalizeColumnFormatter({
|
||||
kind: "foreign-key-display",
|
||||
referenceMode: "manual",
|
||||
refTable: "dictionary",
|
||||
refColumn: "dict_key",
|
||||
displayColumn: "dict_value",
|
||||
filter: { column: "dict_type", mode },
|
||||
}),
|
||||
).toMatchObject({ filter: { column: "dict_type", mode, value: undefined, endValue: undefined } });
|
||||
});
|
||||
});
|
||||
|
||||
describe("normalizeSupportedDateTimePattern", () => {
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import type { DataGridContextFilterMode } from "@/lib/dataGrid/dataGridSql";
|
||||
|
||||
describe("VictoriaMetrics data grid filters", () => {
|
||||
it("does not expose SQL filter modes for MetricsQL results", () => {
|
||||
const modes: DataGridContextFilterMode[] = ["equals", "not-equals", "is-null", "is-not-null", "like", "not-like", "less-than", "greater-than", "in", "not-in", "between", "not-between"];
|
||||
const modes: DataGridContextFilterMode[] = ["equals", "not-equals", "is-null", "is-not-null", "is-blank", "is-not-blank", "like", "not-like", "less-than", "greater-than", "in", "not-in", "between", "not-between"];
|
||||
|
||||
expect(modes.every((mode) => !filterModeIsSupportedForDatabase(mode, "victoriametrics"))).toBe(true);
|
||||
expect(filterModeIsSupportedForDatabase("equals", "postgres")).toBe(true);
|
||||
|
||||
Reference in new issue
Block a user