29 lines
629 B
TypeScript
29 lines
629 B
TypeScript
import { createAndFilter, createRangeFilter } from "../../src/graphql/filter";
|
|
|
|
describe("create filterInput", () => {
|
|
it("should create a filter input with the correct structure", () => {
|
|
const feature = "cueObjectAngle";
|
|
const greaterThanEqualTo = 10;
|
|
const lessThan = 20;
|
|
|
|
const rangeFilter = createRangeFilter(
|
|
feature,
|
|
greaterThanEqualTo,
|
|
lessThan,
|
|
);
|
|
const andFilterInput = createAndFilter([rangeFilter]);
|
|
expect(andFilterInput.createVars()).toEqual({
|
|
andFilters: {
|
|
filters: [
|
|
{
|
|
[feature]: {
|
|
greaterThanEqualTo,
|
|
lessThan,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
});
|
|
});
|
|
});
|