fix: rename schedule to planning

feat: NotesAPI
This commit is contained in:
dd060606
2024-11-19 09:22:33 +01:00
parent 23449c26d2
commit 243ff072df
9 changed files with 178 additions and 89 deletions

View File

@@ -1,4 +1,5 @@
import { login } from "../src/api/Session";
import { noteAverage } from "../src/utils/NotesUtils";
describe("NotesApi", () => {
it("should receive notes", async () => {
const username = process.env.TEST_USERNAME;
@@ -10,7 +11,12 @@ describe("NotesApi", () => {
}
const session = await login(username, password);
const schedule = await session.getNotesApi().fetchNotes();
expect(schedule).not.toBeDefined();
const notes = await session.getNotesApi().fetchNotes();
console.log(JSON.stringify(notes, null, 2));
console.log("Les moyennes: ");
notes.forEach((note) => {
console.log(note.code + ": " + noteAverage(note.notes));
});
expect(notes).toBeInstanceOf(Array);
});
});

View File

@@ -1,6 +1,6 @@
import { login } from "../src/api/Session";
describe("ScheduleApi", () => {
it("should receive a schedule", async () => {
describe("PlanningApi", () => {
it("should receive a planning", async () => {
const username = process.env.TEST_USERNAME;
const password = process.env.TEST_PASSWORD;
if (!username || !password) {
@@ -10,7 +10,8 @@ describe("ScheduleApi", () => {
}
const session = await login(username, password);
const schedule = await session.getScheduleApi().fetchSchedule();
expect(schedule).toBeInstanceOf(Array);
const planning = await session.getPlanningApi().fetchPlanning();
console.log(planning);
expect(planning).toBeInstanceOf(Array);
});
});