|
1 | 1 | import { StatusCodes } from "http-status-codes"; |
2 | 2 | import { Temporal } from "temporal-polyfill"; |
3 | 3 | import { describe, expect } from "vitest"; |
4 | | -import type { AboutNode } from "#/system/system.services"; |
5 | 4 | import { expectErrorResponse } from "./fixture/assertions"; |
6 | 5 | import { createTestFixtureExtension } from "./fixture/it"; |
7 | 6 |
|
@@ -68,14 +67,17 @@ describe("node maintenance window management", () => { |
68 | 67 | const response = await admin.about(); |
69 | 68 | expect(response.status).toBe(StatusCodes.OK); |
70 | 69 |
|
71 | | - const result = (await response.json()) as AboutNode; |
72 | | - expect(result).toHaveProperty("maintenance"); |
73 | | - expect(result?.maintenance?.start).toEqual( |
74 | | - maintenanceWindow.start.toISOString(), |
75 | | - ); |
76 | | - expect(result?.maintenance?.end).toEqual( |
77 | | - maintenanceWindow.end.toISOString(), |
78 | | - ); |
| 70 | + const result = (await response.json()) as { |
| 71 | + maintenance: { start: string; end: string }; |
| 72 | + }; |
| 73 | + |
| 74 | + const { start: expectedStart, end: expectedEnd } = maintenanceWindow; |
| 75 | + |
| 76 | + const actualStart = new Date(result.maintenance.start).getUTCSeconds(); |
| 77 | + expect(actualStart).toEqual(expectedStart.getUTCSeconds()); |
| 78 | + |
| 79 | + const actualEnd = new Date(result.maintenance.end).getUTCSeconds(); |
| 80 | + expect(actualEnd).toEqual(expectedEnd.getUTCSeconds()); |
79 | 81 | }); |
80 | 82 |
|
81 | 83 | it("can delete a maintenance window", async ({ expect, admin }) => { |
|
0 commit comments