Skip to content

Commit 2b77734

Browse files
Move oidc-manager test from unit to integration
1 parent 2921a54 commit 2b77734

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

‎test/integration/oidc-manager.js‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
'use strict'
2+
3+
const chai = require('chai')
4+
const expect = chai.expect
5+
const path = require('path')
6+
const fs = require('fs-extra')
7+
8+
const OidcManager = require('../../lib/models/oidc-manager')
9+
const SolidHost = require('../../lib/models/solid-host')
10+
11+
const dbPath = path.join(__dirname, '../resources/.db')
12+
13+
describe('OidcManager', () => {
14+
beforeEach(() => {
15+
fs.removeSync(dbPath)
16+
})
17+
18+
describe('fromServerConfig()', () => {
19+
it('should result in an initialized oidc object', () => {
20+
let serverUri = 'https://localhost:8443'
21+
let host = SolidHost.from({ serverUri })
22+
23+
let saltRounds = 5
24+
let argv = {
25+
host,
26+
dbPath,
27+
saltRounds
28+
}
29+
30+
let oidc = OidcManager.fromServerConfig(argv)
31+
32+
expect(oidc.rs.defaults.query).to.be.true
33+
expect(oidc.clients.store.backend.path.endsWith('db/oidc/rp/clients'))
34+
expect(oidc.provider.issuer).to.equal(serverUri)
35+
expect(oidc.users.backend.path.endsWith('db/oidc/users'))
36+
expect(oidc.users.saltRounds).to.equal(saltRounds)
37+
})
38+
})
39+
})

0 commit comments

Comments
 (0)