Fix unit test

This commit is contained in:
Laurent Nguyen 2024-08-22 14:30:35 +02:00
parent a2556dad06
commit 905aa26f27
1 changed files with 6 additions and 2 deletions

View File

@ -69,7 +69,7 @@ jest.mock("Explorer/Controls/Dialog", () => ({
useDialog: {
getState: jest.fn(() => ({
showOkCancelModalDialog: (title: string, subText: string, okLabel: string, onOk: () => void) => onOk(),
showOkModalDialog: () => {},
showOkModalDialog: () => { },
})),
},
}));
@ -92,7 +92,11 @@ async function waitForComponentToPaint<P = unknown>(wrapper: ReactWrapper<P> | S
describe("Documents tab (noSql API)", () => {
describe("buildQuery", () => {
it("should generate the right select query for SQL API", () => {
expect(buildQuery(false, "")).toContain("select");
expect(buildQuery(false, "", ['pk'], {
paths: ['pk'],
kind: 'Hash',
version: 2,
})).toContain("select");
});
});