1
0
Fork 0
mirror of synced 2024-10-01 01:28:51 +13:00

Fix tests.

This commit is contained in:
Sam Rose 2024-04-11 17:16:32 +01:00
parent 12fdaefe4c
commit a024a28de1
No known key found for this signature in database

View file

@ -271,58 +271,40 @@ describe.each([
expectQuery({
range: { age: { low: 5, high: 10 } },
}).toContain([{ age: 10 }]))
})
describe("sort", () => {
it("sorts ascending", () =>
expectSearch({
query: {},
sort: "age",
sortOrder: SortOrder.ASCENDING,
}).toMatch([{ age: 1 }, { age: 10 }]))
describe("sort", () => {
it("sorts ascending", () =>
expectSearch({
query: {},
sort: "age",
sortOrder: SortOrder.ASCENDING,
}).toMatch([{ age: 1 }, { age: 10 }]))
it("sorts descending", () =>
expectSearch({
query: {},
sort: "age",
sortOrder: SortOrder.DESCENDING,
}).toMatch([{ age: 10 }, { age: 1 }]))
})
it("sorts descending", () =>
expectSearch({
query: {},
sort: "age",
sortOrder: SortOrder.DESCENDING,
}).toMatch([{ age: 10 }, { age: 1 }]))
})
describe("sortType NUMBER", () => {
it("sorts ascending", () =>
expectSearch({
query: {},
sort: "age",
sortType: SortType.NUMBER,
sortOrder: SortOrder.ASCENDING,
}).toMatch([{ age: 1 }, { age: 10 }]))
describe("sortType NUMBER", () => {
it("sorts ascending", () =>
expectSearch({
query: {},
sort: "age",
sortType: SortType.NUMBER,
sortOrder: SortOrder.ASCENDING,
}).toMatch([{ age: 1 }, { age: 10 }]))
it("sorts descending", () =>
expectSearch({
query: {},
sort: "age",
sortType: SortType.NUMBER,
sortOrder: SortOrder.DESCENDING,
}).toMatch([{ age: 10 }, { age: 1 }]))
})
describe("sortType STRING", () => {
it("sorts ascending", () =>
expectSearch({
query: {},
sort: "age",
sortType: SortType.STRING,
sortOrder: SortOrder.ASCENDING,
}).toMatch([{ age: 1 }, { age: 10 }]))
it("sorts descending", () =>
expectSearch({
query: {},
sort: "age",
sortType: SortType.STRING,
sortOrder: SortOrder.DESCENDING,
}).toMatch([{ age: 10 }, { age: 1 }]))
})
it("sorts descending", () =>
expectSearch({
query: {},
sort: "age",
sortType: SortType.NUMBER,
sortOrder: SortOrder.DESCENDING,
}).toMatch([{ age: 10 }, { age: 1 }]))
})
})