forked from nodeSolidServer/node-solid-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoidc-manager-test.js
More file actions
39 lines (31 loc) · 1.04 KB
/
oidc-manager-test.js
File metadata and controls
39 lines (31 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'use strict'
const chai = require('chai')
const expect = chai.expect
const path = require('path')
const fs = require('fs-extra')
const OidcManager = require('../../lib/models/oidc-manager')
const SolidHost = require('../../lib/models/solid-host')
const dbPath = path.join(__dirname, '../resources/.db')
describe('OidcManager', () => {
beforeEach(() => {
fs.removeSync(dbPath)
})
describe('fromServerConfig()', () => {
it('should result in an initialized oidc object', () => {
let serverUri = 'https://localhost:8443'
let host = SolidHost.from({ serverUri })
let saltRounds = 5
let argv = {
host,
dbPath,
saltRounds
}
let oidc = OidcManager.fromServerConfig(argv)
expect(oidc.rs.defaults.query).to.be.true
expect(oidc.clients.store.backend.path.endsWith('db/oidc/rp/clients'))
expect(oidc.provider.issuer).to.equal(serverUri)
expect(oidc.users.backend.path.endsWith('db/oidc/users'))
expect(oidc.users.saltRounds).to.equal(saltRounds)
})
})
})