update tests
This commit is contained in:
1 parent
6587ddf389
commit
f7e1793bac
8 files changed
+392
-11
No files matched your search
@@ -3,8 +3,23 @@ import {
|
||||
createMonitorBodyValidation,
|
||||
editMonitorBodyValidation,
|
||||
importMonitorsBodyValidation,
|
||||
getDockerContainerLogsQueryValidation,
|
||||
} from "../../../src/api/validation/monitorValidation.ts";
|
||||
|
||||
describe("getDockerContainerLogsQueryValidation", () => {
|
||||
it("defaults limit to 20", () => {
|
||||
expect(getDockerContainerLogsQueryValidation.parse({})).toEqual({ limit: 20 });
|
||||
});
|
||||
|
||||
it("rejects a limit above 50", () => {
|
||||
expect(() => getDockerContainerLogsQueryValidation.parse({ limit: 51 })).toThrow();
|
||||
});
|
||||
|
||||
it("rejects a non-ISO before cursor", () => {
|
||||
expect(() => getDockerContainerLogsQueryValidation.parse({ before: "yesterday" })).toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
const baseDnsBody = {
|
||||
name: "DNS check",
|
||||
type: "dns" as const,
|
||||
|
||||
Reference in new issue
Block a user