mirror of
https://github.com/dd060606/WebAurion-API.git
synced 2026-01-18 16:47:26 +01:00
fix: rename schedule to planning
feat: NotesAPI
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user