REST Service for POPCORN - ILIAS
alex
2025-06-19 d4ae60cc11e08968ab20d09a3c367462161e4d26
test/testImportIliasUser.js
@@ -2,6 +2,7 @@
const settings = require("../settings")
const libIlias = require("../lib/libIlias")
const db = require("../lib/db")
/////////////////////////////////////////////////////////////////////////
@@ -38,10 +39,20 @@
   it("should import a new user to ILIAS", async function () {
      const res = await libIlias.importIliasUser(user)
      console.dir(res, {depth:null})
      // expect(res.method).to.equal("DELETE")
      // expect(res.command).to.equal("deleteUser")
      // expect(res.obj_id).to.equal(obj_id)
      // expect(res.status).to.equal("ok")
      expect(res).to.have.property("status").and.to.equal("ok")
      expect(res.command).to.equal("importUser")
      expect(res.usr_id).to.be.a("number").above(0)
      const {usr_id} = res
      const user2 = await db.getUserByUserId(usr_id)
      console.log(user2)
      expect(user2).to.have.property("login").and.to.equal("affoReloaded")
      expect(user2).to.have.property("usr_id").and.to.equal(res.usr_id)
      const res2 = await libIlias.deleteUser(usr_id)
      console.log(res2)
      expect(res2).to.have.property("status").and.to.equal("ok")
      expect(res2).to.have.property("command").and.to.equal("deleteUser")
   })
})