-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmocha_test.js
81 lines (59 loc) · 1.82 KB
/
mocha_test.js
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
var request = require('supertest');
var chai = require('chai');
chai.use(require('chai-json-schema'));
var assert = chai.assert;
var should = chai.should();
request = request('https://identity.oada-dev.com');
describe('Check Pre-requisites', function(){
describe('Exists .well_known/oada-configuration', function(){
it('should respond with oada-configuration document', function(done){
request
.get('/.well-known/oada-configuration')
.set('Accept', 'application/json')
.expect('Content-Type', /json/)
.expect(200)
.end(function(err,res){
should.not.exist(err);
assert.jsonSchema(JSON.parse(res.text),
require("./schema/oada_configuration.json"));
done();
});
});
});
describe('Exists .well_known/oada-client-discovery', function(){
it('should respond with oada-client-discovery document', function(done){
request
.get('/.well-known/oada-client-discovery')
.set('Accept', 'application/json')
.expect('Content-Type', /json/)
.expect(200)
.end(function(err,res){
should.not.exist(err);
assert.jsonSchema(JSON.parse(res.text),
require("./schema/oada_client_discovery.json"));
done();
});
});
});
});
describe('Obtaining a token in code flow', function(){
describe('Logging in', function(){
it('authorized access, when using correct credential', function(done){
done();
});
it('denied access, when using gibberish credential', function(done){
done();
});
after(function(){
//save cookie
});
});
describe('Grant Screen', function(){
it('correctly displays all requested scopes', function(done){
done();
});
it('correctly displays trust level', function(done){
done();
});
});
});