Gestion de la session + En cours: Emploi du temps

This commit is contained in:
dd060606
2024-11-16 19:17:36 +01:00
parent d807c0d514
commit b0b91d7949
13 changed files with 4369 additions and 0 deletions

15
tests/ScheduleApi.test.ts Normal file
View File

@@ -0,0 +1,15 @@
import { login } from "../src/api/Session";
describe("ScheduleApi", () => {
it("should receive a schedule", async () => {
const username = process.env.TEST_USERNAME;
const password = process.env.TEST_PASSWORD;
if (!username || !password) {
throw new Error(
"TEST_USERNAME or TEST_PASSWORD is not set in environment variables.",
);
}
const session = await login(username, password);
await session.getScheduleApi().fetchSchedule();
});
});

15
tests/Session.test.ts Normal file
View File

@@ -0,0 +1,15 @@
import { login } from "../src/api/Session";
describe("AuthApi", () => {
it("should log in a user and receive a session", async () => {
const username = process.env.TEST_USERNAME;
const password = process.env.TEST_PASSWORD;
if (!username || !password) {
throw new Error(
"TEST_USERNAME or TEST_PASSWORD is not set in environment variables.",
);
}
const result = await login(username, password);
expect(result).toBeDefined();
});
});