| | |
| | | |
| | | it("should return the offline or online status of a kurs", async function () { |
| | | const url = getUrl(ref_id) |
| | | console.log(url) |
| | | const res = await fetch(url, { |
| | | method: "GET", |
| | | // body: JSON.stringify(body), |
| | |
| | | 'Content-Type': 'application/json', // Indicate JSON data |
| | | }, |
| | | }) |
| | | // console.log(res) |
| | | const data = await res.json() |
| | | console.log(data) |
| | | |
| | | expect(data).to.be.a("object").and.to.have.property("offline") |
| | | }) |
| | |
| | | |
| | | it("should set the offline or online status of a kurs", async function () { |
| | | const url = getUrl(ref_id) |
| | | console.log(url) |
| | | const body = {offline: 0} |
| | | const res = await fetch(url, { |
| | | method: "POST", |
| | |
| | | 'Content-Type': 'application/json', // Indicate JSON data |
| | | }, |
| | | }) |
| | | // console.log(res) |
| | | const data = await res.json() |
| | | console.log(data) |
| | | expect(data).to.be.a("object").and.to.have.property("offline") |
| | | }) |
| | | |
| | |
| | | |
| | | it("should return an answer from php component", async function () { |
| | | const url = getUrl(ref_id) |
| | | console.log(url) |
| | | const res = await fetch(url, { |
| | | method: "GET", |
| | | // body: JSON.stringify({}), |
| | | headers: { |
| | | 'Content-Type': 'application/json', // Indicate JSON data |
| | | }, |
| | | }) |
| | | const data = await res.json() |
| | | // console.log(data) |
| | | |
| | | expect(data).to.be.a("object") |
| | | expect(data.status).to.equal("ok") |
| | |
| | | describe("the function getCourseAdminRoles()", function () { |
| | | it("should return all admin roles for all courses", async function () { |
| | | const res = await db.getCourseAdminRoles() |
| | | // console.table(res) |
| | | // console.log(res) |
| | | expect(res).to.be.a("array") |
| | | for (const item of res) { |
| | | expect(item).to.have.property("crs_obj_id").and.to.be.a("number") |
| | |
| | | describe("the function getCoursesWithoutAdminRoles()", function () { |
| | | it("should return all admin roles for all courses", async function () { |
| | | const res = await db.getCourseWithoutAdminRoles() |
| | | // console.table(res) |
| | | console.log(res) |
| | | expect(res).to.be.a("array") |
| | | for (const item of res) { |
| | | expect(item).to.have.property("crs_obj_id").and.to.be.a("number") |
| | |
| | | afterEach(async function () { |
| | | }) |
| | | |
| | | it("should create a new Kurs in ILIAS", async function () { |
| | | it.skip("should create a new Kurs in ILIAS", async function () { |
| | | console.log("++createKurs", kurs) |
| | | const res = await libIlias.createKurs(kurs) |
| | | console.dir(res, {depth: null}) |