REST Service for POPCORN - ILIAS
alex
7 hours ago 2920ccfa508fe5e8c32905fe102758b65fb37574
GS-2555
4 files modified
15 ■■■■■ changed files
test/testApiKursOffline.js 6 ●●●●● patch | view | raw | blame | history
test/testApiPing.js 3 ●●●●● patch | view | raw | blame | history
test/testCourseAdmins.js 4 ●●●●● patch | view | raw | blame | history
test/testCreateKurs.js 2 ●●●●● patch | view | raw | blame | history
test/testApiKursOffline.js
@@ -19,7 +19,6 @@
        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),
@@ -27,9 +26,7 @@
                    '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")
        })
@@ -40,7 +37,6 @@
        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",
@@ -49,9 +45,7 @@
                    '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")
        })
test/testApiPing.js
@@ -16,16 +16,13 @@
        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")
test/testCourseAdmins.js
@@ -19,8 +19,6 @@
   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")
@@ -35,8 +33,6 @@
   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")
test/testCreateKurs.js
@@ -18,7 +18,7 @@
   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})