mirror of
https://github.com/dd060606/WebAurion-API.git
synced 2026-03-18 21:50:38 +01:00
Gestion de la session + En cours: Emploi du temps
This commit is contained in:
15
tests/ScheduleApi.test.ts
Normal file
15
tests/ScheduleApi.test.ts
Normal 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
15
tests/Session.test.ts
Normal 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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user