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 functions for Course Admins", function () {
|
|
beforeEach(async function () {
|
})
|
|
afterEach(async function () {
|
})
|
|
describe("the function getCourseAdmins()", function () {
|
it("should get the Admins of all courses", async function () {
|
const res = await db.getCourseAdmins()
|
console.table(res)
|
expect(res).to.be.a("array")
|
for (const item of res) {
|
expect(item).to.have.property("kurs_obj_id").and.to.be.a("number")
|
expect(item).to.have.property("kurs_ref_id").and.to.be.a("number")
|
expect(item).to.have.property("usr_id").and.to.be.a("number")
|
expect(item).to.have.property("login").and.to.be.a("string")
|
expect(item).to.have.property("firstname").and.to.be.a("string")
|
expect(item).to.have.property("lastname").and.to.be.a("string")
|
expect(item).to.have.property("title").and.to.be.a("string")
|
}
|
})
|
})
|
|
describe("the function getCoursesWithNoAdmins()", function () {
|
it("should return all courses without a single admin member", async function () {
|
const res = await db.getCoursesWithNoAdmins()
|
console.table(res)
|
expect(res).to.be.a("array")
|
for (const item of res) {
|
expect(item).to.have.property("obj_id").and.to.be.a("number")
|
expect(item).to.have.property("ref_id").and.to.be.a("number")
|
expect(item).to.have.property("numTn").and.to.be.a("number")
|
expect(item).to.have.property("title").and.to.be.a("string")
|
}
|
})
|
})
|
|
})
|
|
/////////////////////////////////////////////////////////////////////////
|