walnut.js/tests/schemes-config.js

48 lines
3.5 KiB
JavaScript
Raw Permalink Normal View History

2015-11-12 11:14:59 +00:00
'use strict';
2015-11-14 04:25:12 +00:00
var deserialize = require('../lib/schemes-config').deserialize;
var getVhostsMap = require('../lib/schemes-config').getVhostsMap;
var getDomainInfo = require('../lib/utils').getDomainInfo;
2015-11-12 11:14:59 +00:00
// var results = {"apis":[{"id":"oauth3-api","createdAt":null,"updatedAt":null,"deletedAt":null,"revokedAt":null,"name":null,"json":null}],"apps":[{"id":"oauth3-app","createdAt":null,"updatedAt":null,"deletedAt":null,"revokedAt":null,"name":null,"json":null},{"id":"hellabit-app","createdAt":null,"updatedAt":null,"deletedAt":null,"revokedAt":null,"name":null,"json":null},{"id":"ldsio-app","createdAt":null,"updatedAt":null,"deletedAt":null,"revokedAt":null,"name":null,"json":null},{"id":"ldsconnect-app","createdAt":null,"updatedAt":null,"deletedAt":null,"revokedAt":null,"name":null,"json":null}],"domains":[{"id":"oauth3.org","createdAt":null,"updatedAt":null,"deletedAt":null,"revokedAt":null,"name":null,"token":null,"accountId":null,"json":null},{"id":"lds.io","createdAt":null,"updatedAt":null,"deletedAt":null,"revokedAt":null,"name":null,"token":null,"accountId":null,"json":null},{"id":"ldsconnect.org","createdAt":null,"updatedAt":null,"deletedAt":null,"revokedAt":null,"name":null,"token":null,"accountId":null,"json":null},{"id":"hellabit.com","createdAt":null,"updatedAt":null,"deletedAt":null,"revokedAt":null,"name":null,"token":null,"accountId":null,"json":null},{"id":"hellabit.com#connect","createdAt":null,"updatedAt":null,"deletedAt":null,"revokedAt":null,"name":null,"token":null,"accountId":null,"json":null}],"apisDomains":[{"id":"oauth3-api_oauth3.org","createdAt":null,"updatedAt":null,"deletedAt":null,"apiId":"oauth3-api","domainId":"oauth3.org","json":null}],"appsDomains":[{"id":"oauth3-app_oauth3.org","createdAt":null,"updatedAt":null,"deletedAt":null,"appId":"oauth3-app","domainId":"oauth3.org","json":null},{"id":"hellabit-app_hellabit.com","createdAt":null,"updatedAt":null,"deletedAt":null,"appId":"hellabit-app","domainId":"hellabit.com","json":null},{"id":"ldsio-app_lds.io","createdAt":null,"updatedAt":null,"deletedAt":null,"appId":"ldsio-app","domainId":"lds.io","json":null},{"id":"ldsconnect-app_ldsconnect.org","createdAt":null,"updatedAt":null,"deletedAt":null,"appId":"ldsconnect-app","domainId":"ldsconnect.org","json":null}]};
var results = {
"apis":[
2015-11-14 04:25:12 +00:00
{"id":"org.oauth3"}
2015-11-12 11:14:59 +00:00
]
, "apps":[
{"id":"oauth3-app"}
, {"id":"hellabit-app"}
, {"id":"ldsio-app"}
, {"id":"ldsconnect-app"}
]
, "domains":[
{"id":"oauth3.org"}
, {"id":"lds.io"}
, {"id":"ldsconnect.org"}
, {"id":"hellabit.com#####"}
, {"id":"hellabit.com"}
, {"id":"hellabit.com###"}
, {"id":"hellabit.com#connect###"}
, {"id":"hellabit.com#connect"}
, {"id":"hellabit.com#connect#too"}
]
, "apisDomains":[
2015-11-14 04:25:12 +00:00
{"id":"org.oauth3_oauth3.org","apiId":"org.oauth3","domainId":"oauth3.org"}
, {"id":"org.oauth3_hellabit.com#connect###","apiId":"org.oauth3","domainId":"hellabit.com#connect###"}
2015-11-12 11:14:59 +00:00
]
,"appsDomains":[
{"id":"oauth3-app_oauth3.org","appId":"oauth3-app","domainId":"oauth3.org"}
, {"id":"hellabit-app_hellabit.com","appId":"hellabit-app","domainId":"hellabit.com"}
, {"id":"hellabit-app_hellabit.com###","appId":"hellabit-app","domainId":"hellabit.com#connect###"}
, {"id":"ldsio-app_lds.io","appId":"ldsio-app","domainId":"lds.io"}
, {"id":"ldsconnect-app_ldsconnect.org","appId":"ldsconnect-app","domainId":"ldsconnect.org"}
]
};
var req = { host: 'hellabit.com', url: '/connect' };
2015-11-14 04:25:12 +00:00
module.exports.create({
2015-11-21 20:47:28 +00:00
pagespath: '../packages/apps/'
2015-11-14 04:25:12 +00:00
, apipath: '../packages/apis/'
, vhostsMap: vhostsMap
}).api(req);