| | |
| | | */ |
| | | |
| | | const expect = require("chai").expect |
| | | |
| | | const settings = require("../settings") |
| | | const libIlias = require("../lib/libIlias") |
| | | const db = require("../lib/db"); |
| | | |
| | | ///////////////////////////////////////////////////////////////////////// |
| | | |
| | |
| | | const urlS = settings.ilias.url |
| | | const urlD = new URL(urlS) |
| | | const url = urlD.origin |
| | | |
| | | |
| | | beforeEach(async function () { |
| | | }) |
| | | |
| | | afterEach(async function () { |
| | | }) |
| | | |
| | | describe("the ILIAS URL", function () { |
| | | it("should be accessible", async function () { |
| | |
| | | it("should be accessible", async function () { |
| | | const db = require("../lib/db") |
| | | const res = await db.getUsers(0, 1) |
| | | // console.log(res) |
| | | |
| | | expect(res).to.be.a("object") |
| | | expect(res.total).to.be.a("number").above(0) |
| | |
| | | it("should respond to a ping request", async function () { |
| | | const libIlias = require("../lib/libIlias") |
| | | const res = await libIlias.ping() |
| | | // console.log(res) |
| | | |
| | | expect(res).to.be.a("object") |
| | | expect(res.method).to.equal("GET") |
| | |
| | | it("should be accessible through GET /version", async function () { |
| | | const urlR = `${settings.restUrl}/api/version` |
| | | const res = await fetch(urlR) |
| | | // console.log(res) |
| | | |
| | | const data = await res.json() |
| | | // console.log(data) |
| | | expect(data).to.be.a("object") |
| | | expect(data).to.have.property("version") |
| | | expect(data.version).to.be.a("string") |
| | |
| | | const urlR = `${settings.restUrl}/api/user?offset=0&limit=1&token=${settings.authtoken}` |
| | | const res = await fetch(urlR) |
| | | expect(res.status).to.equal(200) |
| | | const data = await res.json() |
| | | // console.log(data) |
| | | |
| | | const data = await res.json() |
| | | expect(data).to.be.a("object") |
| | | expect(data.total).to.be.a("number").above(0) |
| | | expect(data.offset).to.equal(0) |