REST Service for POPCORN - ILIAS
alex
6 hours ago 6138ffe99d016cc311f250bc1555b5403b8b1216
test/testCreateKurs.js
@@ -1,33 +1,25 @@
const expect = require("chai").expect
const settings = require("../settings")
const libIlias = require("../lib/libIlias")
const db = require("../lib/db")
const testData = require("./data")
/////////////////////////////////////////////////////////////////////////
describe("the function anmelden", function () {
// Skipped: the ILIAS PHP component does not implement course creation yet
// (php/globus-ilias-rest/login.php -> createKurs() throws "not implemented").
// There is also no deleteKurs() for cleanup, so running this test would leave
// a real course behind. Enable once both exist.
describe("the function createKurs", function () {
   const kurs = testData.kurs // TODO
   let kursId = 31938
   beforeEach(async function () {
   })
   afterEach(async function () {
   })
   const kurs = testData.kurs
   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})
      // expect(res).to.have.property("status").and.to.equal("ok")
      // expect(res.command).to.equal("anmelden")
      // expect(res.method).to.equal("POST")
      expect(res).to.have.property("status").and.to.equal("ok")
      expect(res.command).to.equal("createKurs")
      expect(res).to.have.property("ref_id").and.to.be.a("number").above(0)
   })
})
/////////////////////////////////////////////////////////////////////////