feat: can get schedule using a week number

This commit is contained in:
dd060606
2024-11-27 14:03:07 +01:00
parent f50bb9a706
commit e14825ae29
3 changed files with 42 additions and 29 deletions

View File

@@ -1,4 +1,5 @@
import { login } from "../src/api/Session";
import { getScheduleDates } from "../src/utils/PlanningUtils";
describe("PlanningApi", () => {
it("should receive a planning", async () => {
const username = process.env.TEST_USERNAME;
@@ -14,4 +15,12 @@ describe("PlanningApi", () => {
console.log(planning);
expect(planning).toBeInstanceOf(Array);
});
it("should get schedule dates from week number", async () => {
const { startTimestamp, endTimestamp } = getScheduleDates(3);
console.log(
new Date(startTimestamp).toLocaleString(),
new Date(endTimestamp).toLocaleString(),
);
expect(startTimestamp).toBeLessThan(endTimestamp);
});
});