@webex/test-helper-chai 2.37.0 → 2.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assertions/index.js +8 -25
- package/dist/assertions/index.js.map +1 -1
- package/dist/assertions/primitives.js +4 -13
- package/dist/assertions/primitives.js.map +1 -1
- package/dist/assertions/schemas.js +13 -16
- package/dist/assertions/schemas.js.map +1 -1
- package/dist/assertions/should-to-assert.js +5 -9
- package/dist/assertions/should-to-assert.js.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/assertions/index.js +55 -49
- package/src/assertions/primitives.js +1 -1
- package/src/assertions/schemas.js +16 -43
- package/src/assertions/should-to-assert.js +0 -1
- package/src/index.js +0 -1
package/dist/assertions/index.js
CHANGED
|
@@ -5,36 +5,33 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/* eslint-disable no-invalid-this */
|
|
8
|
-
var checkError = require('check-error');
|
|
9
8
|
|
|
9
|
+
var checkError = require('check-error');
|
|
10
10
|
var file = require('@webex/test-helper-file');
|
|
11
|
-
|
|
12
11
|
var schemas = require('./schemas');
|
|
13
|
-
|
|
14
12
|
var primitives = require('./primitives');
|
|
13
|
+
|
|
15
14
|
/**
|
|
16
15
|
* @param {Object} chai
|
|
17
16
|
* @returns {undefined}
|
|
18
17
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
18
|
module.exports = function registerAssertions(chai) {
|
|
22
|
-
var Assertion = chai.Assertion;
|
|
23
|
-
// longer compatible with IE 11
|
|
19
|
+
var Assertion = chai.Assertion;
|
|
24
20
|
|
|
21
|
+
// The follow assertion is adapted from chai-as-promised as that library is no
|
|
22
|
+
// longer compatible with IE 11
|
|
25
23
|
Assertion.addMethod('rejectedWith', function expectedRejection(errorLike, errMsgMatcher, msg) {
|
|
26
24
|
var assert = chai.assert;
|
|
27
25
|
var flag = chai.util.flag;
|
|
28
|
-
|
|
29
26
|
if (msg) {
|
|
30
27
|
flag(this, 'message', msg);
|
|
31
28
|
}
|
|
32
|
-
|
|
33
29
|
var promise = this.then ? this : this._obj;
|
|
34
30
|
return promise.then(function (actual) {
|
|
35
31
|
assert(false, 'expected #{this} to be rejected but it was fulfilled with #{act}', null, errorLike && errorLike.toString(), actual);
|
|
36
32
|
return actual;
|
|
37
|
-
},
|
|
33
|
+
},
|
|
34
|
+
// complexity is result of basic ternaries
|
|
38
35
|
// eslint-disable-next-line complexity
|
|
39
36
|
function onReject(reason) {
|
|
40
37
|
if (errorLike) {
|
|
@@ -43,70 +40,56 @@ module.exports = function registerAssertions(chai) {
|
|
|
43
40
|
this.assert(false, 'expected #{this} to be rejected with #{exp} but was rejected with #{act}', null, errorLike.toString(), reason.toString());
|
|
44
41
|
}
|
|
45
42
|
}
|
|
46
|
-
|
|
47
43
|
if (!checkError.compatibleConstructor(reason, errorLike)) {
|
|
48
44
|
this.assert(false, 'expected #{this} to be rejected with #{exp} but was rejected with #{act}', null, errorLike instanceof Error ? errorLike.toString() : errorLike && checkError.getConstructorName(errorLike), reason instanceof Error ? reason.toString() : reason && checkError.getConstructorName(reason));
|
|
49
45
|
}
|
|
50
46
|
}
|
|
51
|
-
|
|
52
47
|
if (reason && errMsgMatcher) {
|
|
53
48
|
var placeholder = 'including';
|
|
54
|
-
|
|
55
49
|
if (errMsgMatcher instanceof RegExp) {
|
|
56
50
|
placeholder = 'matching';
|
|
57
51
|
}
|
|
58
|
-
|
|
59
52
|
if (!checkError.compatibleMessage(reason, errMsgMatcher)) {
|
|
60
53
|
this.assert(false, "expected #{this} to be be rejected with error ".concat(placeholder, " #{exp} but got #{act}"), null, errMsgMatcher, checkError.getMessage(reason));
|
|
61
54
|
}
|
|
62
55
|
}
|
|
63
|
-
|
|
64
56
|
return reason;
|
|
65
57
|
});
|
|
66
58
|
});
|
|
67
|
-
|
|
68
59
|
chai.assert.isRejected = function isRejected(promise, errorLike, errMsgMatcher, msg) {
|
|
69
60
|
if (typeof errorLike === 'string' || errorLike instanceof RegExp) {
|
|
70
61
|
errMsgMatcher = errorLike;
|
|
71
62
|
errorLike = null;
|
|
72
63
|
}
|
|
73
|
-
|
|
74
64
|
return new Assertion(promise, msg, chai.assert.isRejected, true).to.be.rejectedWith(errorLike, errMsgMatcher);
|
|
75
65
|
};
|
|
76
|
-
/* eslint no-unused-expressions: [0] */
|
|
77
66
|
|
|
67
|
+
/* eslint no-unused-expressions: [0] */
|
|
78
68
|
|
|
79
69
|
Assertion.addMethod('statusCode', function expectStatusCode(statusCode) {
|
|
80
70
|
this.assert((this._obj.statusCode || this._obj) === statusCode, "expected #{this} to have an HTTP Status Code of ".concat(statusCode), "expected #{this} to not have an HTTP Status Code of ".concat(statusCode));
|
|
81
71
|
});
|
|
82
|
-
|
|
83
72
|
chai.assert.statusCode = function assertStatusCode(obj, statusCode, msg) {
|
|
84
73
|
new Assertion(obj, msg).to.have.statusCode(statusCode);
|
|
85
74
|
};
|
|
86
|
-
|
|
87
75
|
Assertion.addProperty('blobLike', function blobLike() {
|
|
88
76
|
this.assert(file.isBlobLike(this._obj), 'expected #{this} to be a Buffer (nodejs) or Blob (browser)', 'expected #{this} not to be a Buffer (nodejs) or Blob (browser)');
|
|
89
77
|
});
|
|
90
78
|
Assertion.addProperty('bufferLike', function bufferLike() {
|
|
91
79
|
this.assert(file.isBufferLike(this._obj), 'expected #{this} to be a Buffer (nodejs) or ArrayBuffer (browser)', 'expected #{this} not to be a Buffer (nodejs) or ArrayBuffer (browser)');
|
|
92
80
|
});
|
|
93
|
-
|
|
94
81
|
chai.assert.isBlobLike = function isBlobLike(obj, msg) {
|
|
95
82
|
new Assertion(obj, msg).to.be.blobLike;
|
|
96
83
|
};
|
|
97
|
-
|
|
98
84
|
chai.assert.isNotBlobLike = function isNotBlobLike(obj, msg) {
|
|
99
85
|
new Assertion(obj, msg).not.to.be.blobLike;
|
|
100
86
|
};
|
|
101
|
-
|
|
102
87
|
chai.assert.isBufferLike = function isBufferLike(obj, msg) {
|
|
103
88
|
new Assertion(obj, msg).to.be.bufferLike;
|
|
104
89
|
};
|
|
105
|
-
|
|
106
90
|
chai.assert.isNotBufferLike = function isNotBufferLike(obj, msg) {
|
|
107
91
|
new Assertion(obj, msg).not.to.be.bufferLike;
|
|
108
92
|
};
|
|
109
|
-
|
|
110
93
|
primitives(chai);
|
|
111
94
|
schemas(chai);
|
|
112
95
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["checkError","require","file","schemas","primitives","module","exports","registerAssertions","chai","Assertion","addMethod","expectedRejection","errorLike","errMsgMatcher","msg","assert","flag","util","promise","then","_obj","actual","toString","onReject","reason","Error","compatibleInstance","compatibleConstructor","getConstructorName","placeholder","RegExp","compatibleMessage","getMessage","isRejected","to","be","rejectedWith","expectStatusCode","statusCode","assertStatusCode","obj","have","addProperty","blobLike","isBlobLike","bufferLike","isBufferLike","isNotBlobLike","not","isNotBufferLike"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint-disable no-invalid-this */\n\nconst checkError = require('check-error');\nconst file = require('@webex/test-helper-file');\n\nconst schemas = require('./schemas');\nconst primitives = require('./primitives');\n\n/**\n * @param {Object} chai\n * @returns {undefined}\n */\nmodule.exports = function registerAssertions(chai) {\n const {Assertion} = chai;\n\n // The follow assertion is adapted from chai-as-promised as that library is no\n // longer compatible with IE 11\n Assertion.addMethod('rejectedWith', function expectedRejection(errorLike, errMsgMatcher, msg) {\n const {assert} = chai;\n const {flag} = chai.util;\n\n if (msg) {\n flag(this, 'message', msg);\n }\n\n const promise = this.then ? this : this._obj;\n\n return promise
|
|
1
|
+
{"version":3,"names":["checkError","require","file","schemas","primitives","module","exports","registerAssertions","chai","Assertion","addMethod","expectedRejection","errorLike","errMsgMatcher","msg","assert","flag","util","promise","then","_obj","actual","toString","onReject","reason","Error","compatibleInstance","compatibleConstructor","getConstructorName","placeholder","RegExp","compatibleMessage","getMessage","isRejected","to","be","rejectedWith","expectStatusCode","statusCode","assertStatusCode","obj","have","addProperty","blobLike","isBlobLike","bufferLike","isBufferLike","isNotBlobLike","not","isNotBufferLike"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint-disable no-invalid-this */\n\nconst checkError = require('check-error');\nconst file = require('@webex/test-helper-file');\n\nconst schemas = require('./schemas');\nconst primitives = require('./primitives');\n\n/**\n * @param {Object} chai\n * @returns {undefined}\n */\nmodule.exports = function registerAssertions(chai) {\n const {Assertion} = chai;\n\n // The follow assertion is adapted from chai-as-promised as that library is no\n // longer compatible with IE 11\n Assertion.addMethod('rejectedWith', function expectedRejection(errorLike, errMsgMatcher, msg) {\n const {assert} = chai;\n const {flag} = chai.util;\n\n if (msg) {\n flag(this, 'message', msg);\n }\n\n const promise = this.then ? this : this._obj;\n\n return promise.then(\n (actual) => {\n assert(\n false,\n 'expected #{this} to be rejected but it was fulfilled with #{act}',\n null,\n errorLike && errorLike.toString(),\n actual\n );\n\n return actual;\n },\n // complexity is result of basic ternaries\n // eslint-disable-next-line complexity\n function onReject(reason) {\n if (errorLike) {\n if (errorLike instanceof Error) {\n if (!checkError.compatibleInstance(reason, errorLike)) {\n this.assert(\n false,\n 'expected #{this} to be rejected with #{exp} but was rejected with #{act}',\n null,\n errorLike.toString(),\n reason.toString()\n );\n }\n }\n\n if (!checkError.compatibleConstructor(reason, errorLike)) {\n this.assert(\n false,\n 'expected #{this} to be rejected with #{exp} but was rejected with #{act}',\n null,\n errorLike instanceof Error\n ? errorLike.toString()\n : errorLike && checkError.getConstructorName(errorLike),\n reason instanceof Error\n ? reason.toString()\n : reason && checkError.getConstructorName(reason)\n );\n }\n }\n\n if (reason && errMsgMatcher) {\n let placeholder = 'including';\n\n if (errMsgMatcher instanceof RegExp) {\n placeholder = 'matching';\n }\n\n if (!checkError.compatibleMessage(reason, errMsgMatcher)) {\n this.assert(\n false,\n `expected #{this} to be be rejected with error ${placeholder} #{exp} but got #{act}`,\n null,\n errMsgMatcher,\n checkError.getMessage(reason)\n );\n }\n }\n\n return reason;\n }\n );\n });\n\n chai.assert.isRejected = function isRejected(promise, errorLike, errMsgMatcher, msg) {\n if (typeof errorLike === 'string' || errorLike instanceof RegExp) {\n errMsgMatcher = errorLike;\n errorLike = null;\n }\n\n return new Assertion(promise, msg, chai.assert.isRejected, true).to.be.rejectedWith(\n errorLike,\n errMsgMatcher\n );\n };\n\n /* eslint no-unused-expressions: [0] */\n\n Assertion.addMethod('statusCode', function expectStatusCode(statusCode) {\n this.assert(\n (this._obj.statusCode || this._obj) === statusCode,\n `expected #{this} to have an HTTP Status Code of ${statusCode}`,\n `expected #{this} to not have an HTTP Status Code of ${statusCode}`\n );\n });\n\n chai.assert.statusCode = function assertStatusCode(obj, statusCode, msg) {\n new Assertion(obj, msg).to.have.statusCode(statusCode);\n };\n\n Assertion.addProperty('blobLike', function blobLike() {\n this.assert(\n file.isBlobLike(this._obj),\n 'expected #{this} to be a Buffer (nodejs) or Blob (browser)',\n 'expected #{this} not to be a Buffer (nodejs) or Blob (browser)'\n );\n });\n\n Assertion.addProperty('bufferLike', function bufferLike() {\n this.assert(\n file.isBufferLike(this._obj),\n 'expected #{this} to be a Buffer (nodejs) or ArrayBuffer (browser)',\n 'expected #{this} not to be a Buffer (nodejs) or ArrayBuffer (browser)'\n );\n });\n\n chai.assert.isBlobLike = function isBlobLike(obj, msg) {\n new Assertion(obj, msg).to.be.blobLike;\n };\n\n chai.assert.isNotBlobLike = function isNotBlobLike(obj, msg) {\n new Assertion(obj, msg).not.to.be.blobLike;\n };\n\n chai.assert.isBufferLike = function isBufferLike(obj, msg) {\n new Assertion(obj, msg).to.be.bufferLike;\n };\n\n chai.assert.isNotBufferLike = function isNotBufferLike(obj, msg) {\n new Assertion(obj, msg).not.to.be.bufferLike;\n };\n\n primitives(chai);\n schemas(chai);\n};\n"],"mappings":";;AAAA;AACA;AACA;;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AC+B,GAAG,EAAE1B,GAAG,CAAC,CAACkC,GAAG,CAACd,EAAE,CAACC,EAAE,CAACQ,QAAQ;EAC5C,CAAC;EAEDnC,IAAI,CAACO,MAAM,CAAC+B,YAAY,GAAG,SAASA,YAAY,CAACN,GAAG,EAAE1B,GAAG,EAAE;IACzD,IAAIL,SAAS,CAAC+B,GAAG,EAAE1B,GAAG,CAAC,CAACoB,EAAE,CAACC,EAAE,CAACU,UAAU;EAC1C,CAAC;EAEDrC,IAAI,CAACO,MAAM,CAACkC,eAAe,GAAG,SAASA,eAAe,CAACT,GAAG,EAAE1B,GAAG,EAAE;IAC/D,IAAIL,SAAS,CAAC+B,GAAG,EAAE1B,GAAG,CAAC,CAACkC,GAAG,CAACd,EAAE,CAACC,EAAE,CAACU,UAAU;EAC9C,CAAC;EAEDzC,UAAU,CAACI,IAAI,CAAC;EAChBL,OAAO,CAACK,IAAI,CAAC;AACf,CAAC"}
|
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/parse-int"));
|
|
6
|
-
|
|
7
5
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
|
|
8
|
-
|
|
9
6
|
/*!
|
|
10
7
|
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
11
8
|
*/
|
|
12
9
|
|
|
13
10
|
/* eslint-disable no-invalid-this */
|
|
14
|
-
|
|
15
11
|
/* eslint-disable func-names */
|
|
12
|
+
|
|
16
13
|
var shouldToAssert = require('./should-to-assert');
|
|
14
|
+
|
|
17
15
|
/**
|
|
18
16
|
* @param {Object} chai
|
|
19
17
|
* @returns {undefined}
|
|
20
18
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
19
|
module.exports = function (chai) {
|
|
24
20
|
var Assertion = chai.Assertion,
|
|
25
|
-
|
|
21
|
+
assert = chai.assert;
|
|
22
|
+
|
|
26
23
|
/* eslint no-unused-expressions: [0] */
|
|
27
24
|
|
|
28
25
|
var uuidPattern = /^[a-f\d]{8}(?:-[a-f\d]{4}){3}-[a-f\d]{12}$/;
|
|
@@ -46,29 +43,23 @@ module.exports = function (chai) {
|
|
|
46
43
|
});
|
|
47
44
|
Assertion.addMethod('properties', function (properties) {
|
|
48
45
|
var _this = this;
|
|
49
|
-
|
|
50
46
|
properties.forEach(function (property) {
|
|
51
47
|
assert.property(_this._obj, property);
|
|
52
48
|
});
|
|
53
49
|
});
|
|
54
|
-
|
|
55
50
|
chai.assert.properties = function (obj, properties, msg) {
|
|
56
51
|
new Assertion(obj, msg).to.have.properties(properties);
|
|
57
52
|
};
|
|
58
|
-
|
|
59
53
|
Assertion.addMethod('strictProperties', function (properties) {
|
|
60
54
|
var _this2 = this;
|
|
61
|
-
|
|
62
55
|
properties.forEach(function (property) {
|
|
63
56
|
assert.property(_this2._obj, property);
|
|
64
57
|
});
|
|
65
58
|
assert.deepEqual((0, _keys.default)(this._obj).sort(), properties.sort());
|
|
66
59
|
});
|
|
67
|
-
|
|
68
60
|
chai.assert.strictProperties = function (obj, properties, msg) {
|
|
69
61
|
new Assertion(obj, msg).to.have.strictProperties(properties);
|
|
70
62
|
};
|
|
71
|
-
|
|
72
63
|
shouldToAssert(chai, {
|
|
73
64
|
hydraId: 'isHydraID',
|
|
74
65
|
uuid: 'isUUID',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["shouldToAssert","require","module","exports","chai","Assertion","assert","uuidPattern","emailPattern","addProperty","isString","_obj","notMatch","match","isNotNumber","notEqual","toString","addMethod","properties","forEach","property","obj","msg","to","have","deepEqual","sort","strictProperties","hydraId","uuid","email","isoDate"],"sources":["primitives.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint-disable no-invalid-this */\n/* eslint-disable func-names */\n\nconst shouldToAssert = require('./should-to-assert');\n\n/**\n * @param {Object} chai\n * @returns {undefined}\n */\nmodule.exports = function (chai) {\n const {Assertion, assert} = chai;\n\n /* eslint no-unused-expressions: [0] */\n\n const uuidPattern = /^[a-f\\d]{8}(?:-[a-f\\d]{4}){3}-[a-f\\d]{12}$/;\n const emailPattern = /^[^\\s]+?@[^\\s]+?$/;\n\n Assertion.addProperty('hydraId', function () {\n assert.isString(this._obj);\n assert.notMatch(this._obj, uuidPattern);\n });\n\n Assertion.addProperty('uuid', function () {\n assert.isString(this._obj);\n assert.match(this._obj, uuidPattern);\n });\n\n Assertion.addProperty('email', function () {\n assert.isString(this._obj);\n assert.match(this._obj, emailPattern);\n });\n\n Assertion.addProperty('isoDate', function () {\n assert.isString(this._obj);\n assert.isNotNumber(this._obj);\n assert.notEqual(parseInt(this._obj, 10).toString(), this._obj);\n });\n\n Assertion.addMethod('properties', function (properties) {\n properties.forEach((property) => {\n assert.property(this._obj, property);\n });\n });\n\n chai.assert.properties = function (obj, properties, msg) {\n new Assertion(obj, msg).to.have.properties(properties);\n };\n\n Assertion.addMethod('strictProperties', function (properties) {\n properties.forEach((property) => {\n assert.property(this._obj, property);\n });\n\n assert.deepEqual(Object.keys(this._obj).sort(), properties.sort());\n });\n\n chai.assert.strictProperties = function (obj, properties, msg) {\n new Assertion(obj, msg).to.have.strictProperties(properties);\n };\n\n shouldToAssert(chai, {\n hydraId: 'isHydraID',\n uuid: 'isUUID',\n email: 'isEmail',\n isoDate: 'isISODate'
|
|
1
|
+
{"version":3,"names":["shouldToAssert","require","module","exports","chai","Assertion","assert","uuidPattern","emailPattern","addProperty","isString","_obj","notMatch","match","isNotNumber","notEqual","toString","addMethod","properties","forEach","property","obj","msg","to","have","deepEqual","sort","strictProperties","hydraId","uuid","email","isoDate"],"sources":["primitives.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint-disable no-invalid-this */\n/* eslint-disable func-names */\n\nconst shouldToAssert = require('./should-to-assert');\n\n/**\n * @param {Object} chai\n * @returns {undefined}\n */\nmodule.exports = function (chai) {\n const {Assertion, assert} = chai;\n\n /* eslint no-unused-expressions: [0] */\n\n const uuidPattern = /^[a-f\\d]{8}(?:-[a-f\\d]{4}){3}-[a-f\\d]{12}$/;\n const emailPattern = /^[^\\s]+?@[^\\s]+?$/;\n\n Assertion.addProperty('hydraId', function () {\n assert.isString(this._obj);\n assert.notMatch(this._obj, uuidPattern);\n });\n\n Assertion.addProperty('uuid', function () {\n assert.isString(this._obj);\n assert.match(this._obj, uuidPattern);\n });\n\n Assertion.addProperty('email', function () {\n assert.isString(this._obj);\n assert.match(this._obj, emailPattern);\n });\n\n Assertion.addProperty('isoDate', function () {\n assert.isString(this._obj);\n assert.isNotNumber(this._obj);\n assert.notEqual(parseInt(this._obj, 10).toString(), this._obj);\n });\n\n Assertion.addMethod('properties', function (properties) {\n properties.forEach((property) => {\n assert.property(this._obj, property);\n });\n });\n\n chai.assert.properties = function (obj, properties, msg) {\n new Assertion(obj, msg).to.have.properties(properties);\n };\n\n Assertion.addMethod('strictProperties', function (properties) {\n properties.forEach((property) => {\n assert.property(this._obj, property);\n });\n\n assert.deepEqual(Object.keys(this._obj).sort(), properties.sort());\n });\n\n chai.assert.strictProperties = function (obj, properties, msg) {\n new Assertion(obj, msg).to.have.strictProperties(properties);\n };\n\n shouldToAssert(chai, {\n hydraId: 'isHydraID',\n uuid: 'isUUID',\n email: 'isEmail',\n isoDate: 'isISODate',\n });\n};\n"],"mappings":";;;;;AAAA;AACA;AACA;;AAEA;AACA;;AAEA,IAAMA,cAAc,GAAGC,OAAO,CAAC,oBAAoB,CAAC;;AAEpD;AACA;AACA;AACA;AACAC,MAAM,CAACC,OAAO,GAAG,UAAUC,IAAI,EAAE;EAC/B,IAAOC,SAAS,GAAYD,IAAI,CAAzBC,SAAS;IAAEC,MAAM,GAAIF,IAAI,CAAdE,MA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ACY,UAAU,GAAG,UAAUG,GAAG,EAAEH,UAAU,EAAEI,GAAG,EAAE;IACvD,IAAIjB,SAAS,CAACgB,GAAG,EAAEC,GAAG,CAAC,CAACC,EAAE,CAACC,IAAI,CAACN,UAAU,CAACA,UAAU,CAAC;EACxD,CAAC;EAEDb,SAAS,CAACY,SAAS,CAAC,kBAAkB,EAAE,UAAUC,UAAU,EAAE;IAAA;IAC5DA,UAAU,CAACC,OAAO,CAAC,UAACC,QAAQ,EAAK;MAC/Bd,MAAM,CAACc,QAAQ,CAAC,MAAI,CAACT,IAAI,EAAES,QAAQ,CAAC;IACtC,CAAC,CAAC;IAEFd,MAAM,CAACmB,SAAS,CAAC,mBAAY,IAAI,CAACd,IAAI,CAAC,CAACe,IAAI,EAAE,EAAER,UAAU,CAACQ,IAAI,EAAE,CAAC;EACpE,CAAC,CAAC;EAEFtB,IAAI,CAACE,MAAM,CAACqB,gBAAgB,GAAG,UAAUN,GAAG,EAAEH,UAAU,EAAEI,GAAG,EAAE;IAC7D,IAAIjB,SAAS,CAACgB,GAAG,EAAEC,GAAG,CAAC,CAACC,EAAE,CAACC,IAAI,CAACG,gBAAgB,CAACT,UAAU,CAAC;EAC9D,CAAC;EAEDlB,cAAc,CAACI,IAAI,EAAE;IACnBwB,OAAO,EAAE,WAAW;IACpBC,IAAI,EAAE,QAAQ;IACdC,KAAK,EAAE,SAAS;IAChBC,OAAO,EAAE;EACX,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/* eslint-disable no-invalid-this */
|
|
8
|
-
|
|
9
8
|
/* eslint-disable func-names */
|
|
9
|
+
|
|
10
10
|
var shouldToAssert = require('./should-to-assert');
|
|
11
|
+
|
|
11
12
|
/**
|
|
12
13
|
* @param {Object} chai
|
|
13
14
|
* @returns {undefined}
|
|
14
15
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
16
|
module.exports = function schemas(chai) {
|
|
18
17
|
var Assertion = chai.Assertion,
|
|
19
|
-
|
|
18
|
+
assert = chai.assert;
|
|
19
|
+
|
|
20
20
|
/* eslint no-unused-expressions: [0] */
|
|
21
21
|
|
|
22
22
|
Assertion.addProperty('AccessToken', function () {
|
|
@@ -29,11 +29,11 @@ module.exports = function schemas(chai) {
|
|
|
29
29
|
Assertion.addProperty('FileItem', function () {
|
|
30
30
|
assert.property(this._obj, 'displayName', 'The file has a display name');
|
|
31
31
|
assert.property(this._obj, 'scr', 'The file has an scr');
|
|
32
|
-
assert.property(this._obj.scr, 'loc',
|
|
32
|
+
assert.property(this._obj.scr, 'loc', "The file's scr has an loc");
|
|
33
33
|
});
|
|
34
34
|
Assertion.addProperty('ThumbnailItem', function () {
|
|
35
35
|
assert.property(this._obj, 'scr', 'The thumbnail has an scr');
|
|
36
|
-
assert.property(this._obj.scr, 'loc',
|
|
36
|
+
assert.property(this._obj.scr, 'loc', "The thumbnail's scr has an loc");
|
|
37
37
|
assert.property(this._obj, 'height', 'The thumbnail has a width');
|
|
38
38
|
assert.property(this._obj, 'width', 'The thumbnail has a width');
|
|
39
39
|
});
|
|
@@ -62,7 +62,6 @@ module.exports = function schemas(chai) {
|
|
|
62
62
|
assert.property(this._obj, 'encryptedDisplayName');
|
|
63
63
|
assert.property(this._obj, 'displayName');
|
|
64
64
|
assert.notEqual(this._obj.displayName, this._obj.encryptedDisplayName);
|
|
65
|
-
|
|
66
65
|
if (this._obj.summary) {
|
|
67
66
|
assert.property(this._obj, 'encryptedSummary');
|
|
68
67
|
assert.notEqual(this._obj.summary, this._obj.encryptedSummary);
|
|
@@ -95,10 +94,12 @@ module.exports = function schemas(chai) {
|
|
|
95
94
|
assert.property(this._obj, 'kmsMessage');
|
|
96
95
|
assert.isObject(this._obj.kmsMessage);
|
|
97
96
|
assert.equal(this._obj.kmsMessage.status, 201);
|
|
98
|
-
assert.property(this._obj, 'defaultActivityEncryptionKeyUrl');
|
|
97
|
+
assert.property(this._obj, 'defaultActivityEncryptionKeyUrl');
|
|
98
|
+
// This should be identical to NewEncryptedConversation, but it seems there
|
|
99
99
|
// was an api change at some point
|
|
100
100
|
// assert.property(this._obj, 'kmsResourceObjectUrl');
|
|
101
101
|
});
|
|
102
|
+
|
|
102
103
|
Assertion.addProperty('EncryptedActivity', function () {
|
|
103
104
|
assert.property(this._obj, 'encryptionKeyUrl');
|
|
104
105
|
});
|
|
@@ -117,16 +118,13 @@ module.exports = function schemas(chai) {
|
|
|
117
118
|
assert.isEmail(this._obj.personEmail);
|
|
118
119
|
assert.isISODate(this._obj.created);
|
|
119
120
|
assert.isHydraID(this._obj.roomId);
|
|
120
|
-
|
|
121
121
|
if (this._obj.files) {
|
|
122
122
|
assert.isArray(this._obj.files);
|
|
123
123
|
assert.isAbove(this._obj.files.length, 0);
|
|
124
|
-
|
|
125
124
|
this._obj.files.forEach(function (file) {
|
|
126
125
|
assert.isMessageFile(file);
|
|
127
126
|
});
|
|
128
127
|
}
|
|
129
|
-
|
|
130
128
|
if (this._obj.text) {
|
|
131
129
|
assert.isString(this._obj.text);
|
|
132
130
|
assert.isAbove(this._obj.text.length, 0);
|
|
@@ -139,17 +137,13 @@ module.exports = function schemas(chai) {
|
|
|
139
137
|
assert.properties(this._obj, ['id', 'emails', 'created']);
|
|
140
138
|
assert.isHydraID(this._obj.id);
|
|
141
139
|
assert.isArray(this._obj.emails);
|
|
142
|
-
|
|
143
140
|
this._obj.emails.forEach(function (email) {
|
|
144
141
|
assert.isEmail(email);
|
|
145
142
|
});
|
|
146
|
-
|
|
147
143
|
assert.isISODate(this._obj.created);
|
|
148
|
-
|
|
149
144
|
if (this._obj.familyName) {
|
|
150
145
|
assert.isString(this._obj.familyName);
|
|
151
146
|
}
|
|
152
|
-
|
|
153
147
|
if (this._obj.givenName) {
|
|
154
148
|
assert.isString(this._obj.givenName);
|
|
155
149
|
}
|
|
@@ -185,9 +179,12 @@ module.exports = function schemas(chai) {
|
|
|
185
179
|
assert.isString(this._obj.event);
|
|
186
180
|
assert.isString(this._obj.filter);
|
|
187
181
|
assert.isString(this._obj.targetUrl);
|
|
188
|
-
assert.isString(this._obj.name);
|
|
182
|
+
assert.isString(this._obj.name);
|
|
183
|
+
|
|
184
|
+
// waiting on completion of COLLAB-159
|
|
189
185
|
// assert.isISODate(this._obj.created);
|
|
190
186
|
});
|
|
187
|
+
|
|
191
188
|
shouldToAssert(chai, ['AccessToken', 'Activity', 'Conversation', 'InternalTeam', 'FileItem', 'ThumbnailItem', 'OneOnOneConversation', 'GroupConversation', 'InternalTeamConversation', 'NewEncryptedConversation', 'NewEncryptedInternalTeam', 'EncryptedActivity', 'MachineAccount', 'Membership', 'Message', 'MessageFile', 'Person', 'Room', 'Team', 'TeamMembership', 'TeamRoom', 'Webhook']);
|
|
192
189
|
};
|
|
193
190
|
//# sourceMappingURL=schemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["shouldToAssert","require","module","exports","schemas","chai","Assertion","assert","addProperty","properties","_obj","equal","objectType","property","scr","isDefined","notEqual","displayName","encryptedDisplayName","summary","encryptedSummary","isConversation","include","tags","notInclude","ok","includes","isObject","kmsMessage","status","isHydraID","id","roomId","personId","isEmail","personEmail","isISODate","created","isString","files","isArray","isAbove","length","forEach","file","isMessageFile","text","emails","email","familyName","givenName","title","name","teamId","isRoom","resource","event","filter","targetUrl"],"sources":["schemas.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint-disable no-invalid-this */\n/* eslint-disable func-names */\n\nconst shouldToAssert = require('./should-to-assert');\n\n/**\n * @param {Object} chai\n * @returns {undefined}\n */\nmodule.exports = function schemas(chai) {\n const {Assertion, assert} = chai;\n\n /* eslint no-unused-expressions: [0] */\n\n Assertion.addProperty('AccessToken', function () {\n assert.properties(this._obj, [\n 'access_token',\n 'token_type',\n 'expires',\n 'expires_in',\n 'refresh_token',\n 'refresh_token_expires',\n 'refresh_token_expires_in'\n ]);\n });\n\n Assertion.addProperty('Activity', function () {\n assert.properties(this._obj, [\n 'url',\n 'id',\n 'object',\n 'actor'\n ]);\n\n assert.equal(this._obj.objectType, 'activity');\n });\n\n Assertion.addProperty('FileItem', function () {\n assert.property(this._obj, 'displayName', 'The file has a display name');\n assert.property(this._obj, 'scr', 'The file has an scr');\n assert.property(this._obj.scr, 'loc', 'The file\\'s scr has an loc');\n });\n\n Assertion.addProperty('ThumbnailItem', function () {\n assert.property(this._obj, 'scr', 'The thumbnail has an scr');\n assert.property(this._obj.scr, 'loc', 'The thumbnail\\'s scr has an loc');\n assert.property(this._obj, 'height', 'The thumbnail has a width');\n assert.property(this._obj, 'width', 'The thumbnail has a width');\n });\n\n Assertion.addProperty('Conversation', function () {\n assert.equal(this._obj.objectType, 'conversation');\n assert.property(this._obj, 'id');\n assert.property(this._obj, 'url');\n });\n\n Assertion.addProperty('MachineAccount', function () {\n assert.isDefined(this._obj, 'orgId');\n assert.property(this._obj, 'orgId');\n assert.isDefined(this._obj, 'name');\n assert.property(this._obj, 'name');\n assert.isDefined(this._obj, 'password');\n assert.property(this._obj, 'password');\n assert.isDefined(this._obj, 'email');\n assert.property(this._obj, 'email');\n assert.isDefined(this._obj, 'description');\n assert.property(this._obj, 'description');\n });\n\n Assertion.addProperty('InternalTeam', function () {\n assert.equal(this._obj.objectType, 'team');\n assert.property(this._obj, 'id');\n assert.property(this._obj, 'url');\n assert.property(this._obj, 'generalConversationUuid');\n\n assert.property(this._obj, 'encryptedDisplayName');\n assert.property(this._obj, 'displayName');\n assert.notEqual(this._obj.displayName, this._obj.encryptedDisplayName);\n\n if (this._obj.summary) {\n assert.property(this._obj, 'encryptedSummary');\n assert.notEqual(this._obj.summary, this._obj.encryptedSummary);\n }\n });\n\n Assertion.addProperty('OneOnOneConversation', function () {\n assert.isConversation(this._obj);\n assert.include(this._obj.tags, 'ONE_ON_ONE');\n });\n\n Assertion.addProperty('GroupConversation', function () {\n assert.isConversation(this._obj);\n assert.notInclude(this._obj.tags, 'ONE_ON_ONE');\n });\n\n Assertion.addProperty('InternalTeamConversation', function () {\n assert.isConversation(this._obj);\n assert.property(this._obj, 'team');\n\n assert.ok(this._obj.tags.includes('OPEN') || this._obj.tags.includes('TEAM'), 'Conversation must have `OPEN` or `TEAM` tag');\n\n assert.property(this._obj, 'encryptedDisplayName');\n assert.property(this._obj, 'displayName');\n assert.notEqual(this._obj.displayName, this._obj.encryptedDisplayName);\n });\n\n Assertion.addProperty('NewEncryptedConversation', function () {\n assert.property(this._obj, 'kmsMessage');\n assert.isObject(this._obj.kmsMessage);\n assert.equal(this._obj.kmsMessage.status, 201);\n assert.property(this._obj, 'defaultActivityEncryptionKeyUrl');\n assert.property(this._obj, 'kmsResourceObjectUrl');\n });\n\n Assertion.addProperty('NewEncryptedInternalTeam', function () {\n assert.property(this._obj, 'kmsMessage');\n assert.isObject(this._obj.kmsMessage);\n assert.equal(this._obj.kmsMessage.status, 201);\n assert.property(this._obj, 'defaultActivityEncryptionKeyUrl');\n // This should be identical to NewEncryptedConversation, but it seems there\n // was an api change at some point\n // assert.property(this._obj, 'kmsResourceObjectUrl');\n });\n\n Assertion.addProperty('EncryptedActivity', function () {\n assert.property(this._obj, 'encryptionKeyUrl');\n });\n\n Assertion.addProperty('Membership', function () {\n assert.properties(this._obj, [\n 'id',\n 'roomId',\n 'personId',\n 'personEmail',\n 'isModerator',\n 'isMonitor',\n 'created'\n ]);\n\n assert.isHydraID(this._obj.id);\n assert.isHydraID(this._obj.roomId);\n assert.isHydraID(this._obj.personId);\n assert.isEmail(this._obj.personEmail);\n assert.isISODate(this._obj.created);\n });\n\n Assertion.addProperty('Message', function () {\n assert.properties(this._obj, [\n 'id',\n 'personId',\n 'personEmail',\n 'roomId',\n 'created'\n ]);\n\n assert.isString(this._obj.id);\n assert.isHydraID(this._obj.personId);\n assert.isEmail(this._obj.personEmail);\n assert.isISODate(this._obj.created);\n assert.isHydraID(this._obj.roomId);\n\n if (this._obj.files) {\n assert.isArray(this._obj.files);\n assert.isAbove(this._obj.files.length, 0);\n this._obj.files.forEach((file) => {\n assert.isMessageFile(file);\n });\n }\n\n if (this._obj.text) {\n assert.isString(this._obj.text);\n assert.isAbove(this._obj.text.length, 0);\n }\n });\n\n Assertion.addProperty('MessageFile', function () {\n assert.isString(this._obj);\n });\n\n Assertion.addProperty('Person', function () {\n assert.properties(this._obj, [\n 'id',\n 'emails',\n 'created'\n ]);\n\n assert.isHydraID(this._obj.id);\n assert.isArray(this._obj.emails);\n this._obj.emails.forEach((email) => {\n assert.isEmail(email);\n });\n assert.isISODate(this._obj.created);\n\n if (this._obj.familyName) {\n assert.isString(this._obj.familyName);\n }\n\n if (this._obj.givenName) {\n assert.isString(this._obj.givenName);\n }\n });\n\n Assertion.addProperty('Room', function () {\n assert.properties(this._obj, [\n 'id',\n 'title',\n 'created'\n ]);\n\n assert.isHydraID(this._obj.id);\n assert.isString(this._obj.title);\n assert.isISODate(this._obj.created);\n });\n\n Assertion.addProperty('Team', function () {\n assert.properties(this._obj, [\n 'id',\n 'name',\n 'created'\n ]);\n\n assert.isHydraID(this._obj.id);\n assert.isString(this._obj.name);\n assert.isISODate(this._obj.created);\n });\n\n Assertion.addProperty('TeamMembership', function () {\n assert.properties(this._obj, [\n 'id',\n 'teamId',\n 'personId',\n 'personEmail',\n 'isModerator',\n 'created'\n ]);\n\n assert.isHydraID(this._obj.id);\n assert.isHydraID(this._obj.teamId);\n assert.isHydraID(this._obj.personId);\n assert.isEmail(this._obj.personEmail);\n\n assert.isISODate(this._obj.created);\n });\n\n Assertion.addProperty('TeamRoom', function () {\n assert.isRoom(this._obj);\n assert.property(this._obj, 'teamId');\n });\n\n Assertion.addProperty('Webhook', function () {\n assert.properties(this._obj, [\n 'id',\n 'resource',\n 'event',\n 'filter',\n 'targetUrl',\n 'name'\n ]);\n\n assert.isHydraID(this._obj.id);\n assert.isString(this._obj.resource);\n assert.isString(this._obj.event);\n assert.isString(this._obj.filter);\n assert.isString(this._obj.targetUrl);\n assert.isString(this._obj.name);\n\n // waiting on completion of COLLAB-159\n // assert.isISODate(this._obj.created);\n });\n\n shouldToAssert(chai, [\n 'AccessToken',\n 'Activity',\n 'Conversation',\n 'InternalTeam',\n 'FileItem',\n 'ThumbnailItem',\n 'OneOnOneConversation',\n 'GroupConversation',\n 'InternalTeamConversation',\n 'NewEncryptedConversation',\n 'NewEncryptedInternalTeam',\n 'EncryptedActivity',\n 'MachineAccount',\n 'Membership',\n 'Message',\n 'MessageFile',\n 'Person',\n 'Room',\n 'Team',\n 'TeamMembership',\n 'TeamRoom',\n 'Webhook'\n ]);\n};\n"],"mappings":";;AAAA;AACA;AACA;;AAEA;;AACA;AAEA,IAAMA,cAAc,GAAGC,OAAO,CAAC,oBAAD,CAA9B;AAEA;AACA;AACA;AACA;;;AACAC,MAAM,CAACC,OAAP,GAAiB,SAASC,OAAT,CAAiBC,IAAjB,EAAuB;EACtC,IAAOC,SAAP,GAA4BD,IAA5B,CAAOC,SAAP;EAAA,IAAkBC,MAAlB,GAA4BF,IAA5B,CAAkBE,MAAlB;EAEA;;EAEAD,SAAS,CAACE,WAAV,CAAsB,aAAtB,EAAqC,YAAY;IAC/CD,MAAM,CAACE,UAAP,CAAkB,KAAKC,IAAvB,EAA6B,CAC3B,cAD2B,EAE3B,YAF2B,EAG3B,SAH2B,EAI3B,YAJ2B,EAK3B,eAL2B,EAM3B,uBAN2B,EAO3B,0BAP2B,CAA7B;EASD,CAVD;EAYAJ,SAAS,CAACE,WAAV,CAAsB,UAAtB,EAAkC,YAAY;IAC5CD,MAAM,CAACE,UAAP,CAAkB,KAAKC,IAAvB,EAA6B,CAC3B,KAD2B,EAE3B,IAF2B,EAG3B,QAH2B,EAI3B,OAJ2B,CAA7B;IAOAH,MAAM,CAACI,KAAP,CAAa,KAAKD,IAAL,CAAUE,UAAvB,EAAmC,UAAnC;EACD,CATD;EAWAN,SAAS,CAACE,WAAV,CAAsB,UAAtB,EAAkC,YAAY;IAC5CD,MAAM,CAACM,QAAP,CAAgB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EAqBApD,cAAc,CAACK,IAAD,EAAO,CACnB,aADmB,EAEnB,UAFmB,EAGnB,cAHmB,EAInB,cAJmB,EAKnB,UALmB,EAMnB,eANmB,EAOnB,sBAPmB,EAQnB,mBARmB,EASnB,0BATmB,EAUnB,0BAVmB,EAWnB,0BAXmB,EAYnB,mBAZmB,EAanB,gBAbmB,EAcnB,YAdmB,EAenB,SAfmB,EAgBnB,aAhBmB,EAiBnB,QAjBmB,EAkBnB,MAlBmB,EAmBnB,MAnBmB,EAoBnB,gBApBmB,EAqBnB,UArBmB,EAsBnB,SAtBmB,CAAP,CAAd;AAwBD,CA7RD"}
|
|
1
|
+
{"version":3,"names":["shouldToAssert","require","module","exports","schemas","chai","Assertion","assert","addProperty","properties","_obj","equal","objectType","property","scr","isDefined","notEqual","displayName","encryptedDisplayName","summary","encryptedSummary","isConversation","include","tags","notInclude","ok","includes","isObject","kmsMessage","status","isHydraID","id","roomId","personId","isEmail","personEmail","isISODate","created","isString","files","isArray","isAbove","length","forEach","file","isMessageFile","text","emails","email","familyName","givenName","title","name","teamId","isRoom","resource","event","filter","targetUrl"],"sources":["schemas.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint-disable no-invalid-this */\n/* eslint-disable func-names */\n\nconst shouldToAssert = require('./should-to-assert');\n\n/**\n * @param {Object} chai\n * @returns {undefined}\n */\nmodule.exports = function schemas(chai) {\n const {Assertion, assert} = chai;\n\n /* eslint no-unused-expressions: [0] */\n\n Assertion.addProperty('AccessToken', function () {\n assert.properties(this._obj, [\n 'access_token',\n 'token_type',\n 'expires',\n 'expires_in',\n 'refresh_token',\n 'refresh_token_expires',\n 'refresh_token_expires_in',\n ]);\n });\n\n Assertion.addProperty('Activity', function () {\n assert.properties(this._obj, ['url', 'id', 'object', 'actor']);\n\n assert.equal(this._obj.objectType, 'activity');\n });\n\n Assertion.addProperty('FileItem', function () {\n assert.property(this._obj, 'displayName', 'The file has a display name');\n assert.property(this._obj, 'scr', 'The file has an scr');\n assert.property(this._obj.scr, 'loc', \"The file's scr has an loc\");\n });\n\n Assertion.addProperty('ThumbnailItem', function () {\n assert.property(this._obj, 'scr', 'The thumbnail has an scr');\n assert.property(this._obj.scr, 'loc', \"The thumbnail's scr has an loc\");\n assert.property(this._obj, 'height', 'The thumbnail has a width');\n assert.property(this._obj, 'width', 'The thumbnail has a width');\n });\n\n Assertion.addProperty('Conversation', function () {\n assert.equal(this._obj.objectType, 'conversation');\n assert.property(this._obj, 'id');\n assert.property(this._obj, 'url');\n });\n\n Assertion.addProperty('MachineAccount', function () {\n assert.isDefined(this._obj, 'orgId');\n assert.property(this._obj, 'orgId');\n assert.isDefined(this._obj, 'name');\n assert.property(this._obj, 'name');\n assert.isDefined(this._obj, 'password');\n assert.property(this._obj, 'password');\n assert.isDefined(this._obj, 'email');\n assert.property(this._obj, 'email');\n assert.isDefined(this._obj, 'description');\n assert.property(this._obj, 'description');\n });\n\n Assertion.addProperty('InternalTeam', function () {\n assert.equal(this._obj.objectType, 'team');\n assert.property(this._obj, 'id');\n assert.property(this._obj, 'url');\n assert.property(this._obj, 'generalConversationUuid');\n\n assert.property(this._obj, 'encryptedDisplayName');\n assert.property(this._obj, 'displayName');\n assert.notEqual(this._obj.displayName, this._obj.encryptedDisplayName);\n\n if (this._obj.summary) {\n assert.property(this._obj, 'encryptedSummary');\n assert.notEqual(this._obj.summary, this._obj.encryptedSummary);\n }\n });\n\n Assertion.addProperty('OneOnOneConversation', function () {\n assert.isConversation(this._obj);\n assert.include(this._obj.tags, 'ONE_ON_ONE');\n });\n\n Assertion.addProperty('GroupConversation', function () {\n assert.isConversation(this._obj);\n assert.notInclude(this._obj.tags, 'ONE_ON_ONE');\n });\n\n Assertion.addProperty('InternalTeamConversation', function () {\n assert.isConversation(this._obj);\n assert.property(this._obj, 'team');\n\n assert.ok(\n this._obj.tags.includes('OPEN') || this._obj.tags.includes('TEAM'),\n 'Conversation must have `OPEN` or `TEAM` tag'\n );\n\n assert.property(this._obj, 'encryptedDisplayName');\n assert.property(this._obj, 'displayName');\n assert.notEqual(this._obj.displayName, this._obj.encryptedDisplayName);\n });\n\n Assertion.addProperty('NewEncryptedConversation', function () {\n assert.property(this._obj, 'kmsMessage');\n assert.isObject(this._obj.kmsMessage);\n assert.equal(this._obj.kmsMessage.status, 201);\n assert.property(this._obj, 'defaultActivityEncryptionKeyUrl');\n assert.property(this._obj, 'kmsResourceObjectUrl');\n });\n\n Assertion.addProperty('NewEncryptedInternalTeam', function () {\n assert.property(this._obj, 'kmsMessage');\n assert.isObject(this._obj.kmsMessage);\n assert.equal(this._obj.kmsMessage.status, 201);\n assert.property(this._obj, 'defaultActivityEncryptionKeyUrl');\n // This should be identical to NewEncryptedConversation, but it seems there\n // was an api change at some point\n // assert.property(this._obj, 'kmsResourceObjectUrl');\n });\n\n Assertion.addProperty('EncryptedActivity', function () {\n assert.property(this._obj, 'encryptionKeyUrl');\n });\n\n Assertion.addProperty('Membership', function () {\n assert.properties(this._obj, [\n 'id',\n 'roomId',\n 'personId',\n 'personEmail',\n 'isModerator',\n 'isMonitor',\n 'created',\n ]);\n\n assert.isHydraID(this._obj.id);\n assert.isHydraID(this._obj.roomId);\n assert.isHydraID(this._obj.personId);\n assert.isEmail(this._obj.personEmail);\n assert.isISODate(this._obj.created);\n });\n\n Assertion.addProperty('Message', function () {\n assert.properties(this._obj, ['id', 'personId', 'personEmail', 'roomId', 'created']);\n\n assert.isString(this._obj.id);\n assert.isHydraID(this._obj.personId);\n assert.isEmail(this._obj.personEmail);\n assert.isISODate(this._obj.created);\n assert.isHydraID(this._obj.roomId);\n\n if (this._obj.files) {\n assert.isArray(this._obj.files);\n assert.isAbove(this._obj.files.length, 0);\n this._obj.files.forEach((file) => {\n assert.isMessageFile(file);\n });\n }\n\n if (this._obj.text) {\n assert.isString(this._obj.text);\n assert.isAbove(this._obj.text.length, 0);\n }\n });\n\n Assertion.addProperty('MessageFile', function () {\n assert.isString(this._obj);\n });\n\n Assertion.addProperty('Person', function () {\n assert.properties(this._obj, ['id', 'emails', 'created']);\n\n assert.isHydraID(this._obj.id);\n assert.isArray(this._obj.emails);\n this._obj.emails.forEach((email) => {\n assert.isEmail(email);\n });\n assert.isISODate(this._obj.created);\n\n if (this._obj.familyName) {\n assert.isString(this._obj.familyName);\n }\n\n if (this._obj.givenName) {\n assert.isString(this._obj.givenName);\n }\n });\n\n Assertion.addProperty('Room', function () {\n assert.properties(this._obj, ['id', 'title', 'created']);\n\n assert.isHydraID(this._obj.id);\n assert.isString(this._obj.title);\n assert.isISODate(this._obj.created);\n });\n\n Assertion.addProperty('Team', function () {\n assert.properties(this._obj, ['id', 'name', 'created']);\n\n assert.isHydraID(this._obj.id);\n assert.isString(this._obj.name);\n assert.isISODate(this._obj.created);\n });\n\n Assertion.addProperty('TeamMembership', function () {\n assert.properties(this._obj, [\n 'id',\n 'teamId',\n 'personId',\n 'personEmail',\n 'isModerator',\n 'created',\n ]);\n\n assert.isHydraID(this._obj.id);\n assert.isHydraID(this._obj.teamId);\n assert.isHydraID(this._obj.personId);\n assert.isEmail(this._obj.personEmail);\n\n assert.isISODate(this._obj.created);\n });\n\n Assertion.addProperty('TeamRoom', function () {\n assert.isRoom(this._obj);\n assert.property(this._obj, 'teamId');\n });\n\n Assertion.addProperty('Webhook', function () {\n assert.properties(this._obj, ['id', 'resource', 'event', 'filter', 'targetUrl', 'name']);\n\n assert.isHydraID(this._obj.id);\n assert.isString(this._obj.resource);\n assert.isString(this._obj.event);\n assert.isString(this._obj.filter);\n assert.isString(this._obj.targetUrl);\n assert.isString(this._obj.name);\n\n // waiting on completion of COLLAB-159\n // assert.isISODate(this._obj.created);\n });\n\n shouldToAssert(chai, [\n 'AccessToken',\n 'Activity',\n 'Conversation',\n 'InternalTeam',\n 'FileItem',\n 'ThumbnailItem',\n 'OneOnOneConversation',\n 'GroupConversation',\n 'InternalTeamConversation',\n 'NewEncryptedConversation',\n 'NewEncryptedInternalTeam',\n 'EncryptedActivity',\n 'MachineAccount',\n 'Membership',\n 'Message',\n 'MessageFile',\n 'Person',\n 'Room',\n 'Team',\n 'TeamMembership',\n 'TeamRoom',\n 'Webhook',\n ]);\n};\n"],"mappings":";;AAAA;AACA;AACA;;AAEA;AACA;;AAEA,IAAMA,cAAc,GAAGC,OAAO,CAAC,oBAAoB,CAAC;;AAEpD;AACA;AACA;AACA;AACAC,MAAM,CAACC,OAAO,GAAG,SAASC,OAAO,CAACC,IAAI,EAAE;EACtC,IAAOC,SAAS,GAAYD,IAAI,CAAzBC,SAAS;IAAEC,MAAM,GAAIF,IAAI,CAAdE,MAAM;;EAExB;;EAEAD,SAAS,CAACE,WAAW,CAAC,aAAa,EAAE,YAAY;IAC/CD,MAAM,CAACE,UAAU,CAAC,IAAI,CAACC,IAAI,EAAE,CAC3B,cAAc,EACd,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,eAAe,EACf,uBAAuB,EACvB,0BAA0B,CAC3B,CAAC;EACJ,CAAC,CAAC;EAEFJ,SAAS,CAACE,WAAW,CAAC,UAAU,EAAE,YAAY;IAC5CD,MAAM,CAACE,UAAU,CAAC,IAAI,CAACC,IAAI,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAE9DH,MAAM,CAACI,KAAK,CAAC,IAAI,CAACD,IAAI,CAACE,UAAU,EAAE,UAAU,CAAC;EAChD,CAAC,CAAC;EAEFN,SAAS,CAACE,WAAW,CAAC,UAAU,EAAE,YAAY;IAC5CD,MAAM,CAACM,QAAQ,CAAC,IAAI,CAACH,IAAI,EAAE,aAAa,EAAE,6BAA6B,CAAC;IACxEH,MAAM,CAACM,QAAQ,CAAC,IAAI,CAACH,IAAI,EAAE,KAAK,EAAE,qBAAqB,CAAC;IACxDH,MAAM,CAACM,QAAQ,CAAC,IAAI,CAACH,IAAI,CAACI,GAAG,EAAE,KAAK,EAAE,2BAA2B,CAAC;EACpE,CAAC,CAAC;EAEFR,SAAS,C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E,YAAY;IAC3CD,MAAM,CAACE,UAAU,CAAC,IAAI,CAACC,IAAI,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAExFH,MAAM,CAACuB,SAAS,CAAC,IAAI,CAACpB,IAAI,CAACqB,EAAE,CAAC;IAC9BxB,MAAM,CAAC+B,QAAQ,CAAC,IAAI,CAAC5B,IAAI,CAAC6C,QAAQ,CAAC;IACnChD,MAAM,CAAC+B,QAAQ,CAAC,IAAI,CAAC5B,IAAI,CAAC8C,KAAK,CAAC;IAChCjD,MAAM,CAAC+B,QAAQ,CAAC,IAAI,CAAC5B,IAAI,CAAC+C,MAAM,CAAC;IACjClD,MAAM,CAAC+B,QAAQ,CAAC,IAAI,CAAC5B,IAAI,CAACgD,SAAS,CAAC;IACpCnD,MAAM,CAAC+B,QAAQ,CAAC,IAAI,CAAC5B,IAAI,CAAC0C,IAAI,CAAC;;IAE/B;IACA;EACF,CAAC,CAAC;;EAEFpD,cAAc,CAACK,IAAI,EAAE,CACnB,aAAa,EACb,UAAU,EACV,cAAc,EACd,cAAc,EACd,UAAU,EACV,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC1B,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,aAAa,EACb,QAAQ,EACR,MAAM,EACN,MAAM,EACN,gBAAgB,EAChB,UAAU,EACV,SAAS,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
|
|
6
|
-
|
|
7
5
|
/*!
|
|
8
6
|
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
9
7
|
*/
|
|
8
|
+
|
|
10
9
|
var _require = require('lodash'),
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
isArray = _require.isArray,
|
|
11
|
+
camelCase = _require.camelCase;
|
|
12
|
+
|
|
13
13
|
/**
|
|
14
14
|
* Converts expect/should assertion definitions into assert definitions
|
|
15
15
|
* @param {Object} chai
|
|
@@ -19,8 +19,6 @@ var _require = require('lodash'),
|
|
|
19
19
|
* prepending "is".
|
|
20
20
|
* @returns {undefined}
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
22
|
module.exports = function shouldToAssert(chai, names) {
|
|
25
23
|
var Assertion = chai.Assertion;
|
|
26
24
|
/* eslint no-unused-expressions: [0] */
|
|
@@ -31,19 +29,17 @@ module.exports = function shouldToAssert(chai, names) {
|
|
|
31
29
|
new Assertion(obj, msg).to.be.a[key];
|
|
32
30
|
};
|
|
33
31
|
});
|
|
32
|
+
|
|
34
33
|
/**
|
|
35
34
|
* @private
|
|
36
35
|
* @param {string} key
|
|
37
36
|
* @returns {string}
|
|
38
37
|
*/
|
|
39
|
-
|
|
40
38
|
function computeAssertionName(key) {
|
|
41
39
|
var name = names[key];
|
|
42
|
-
|
|
43
40
|
if (name) {
|
|
44
41
|
return name;
|
|
45
42
|
}
|
|
46
|
-
|
|
47
43
|
return camelCase("is_".concat(key));
|
|
48
44
|
}
|
|
49
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["require","isArray","camelCase","module","exports","shouldToAssert","chai","names","Assertion","keys","forEach","key","assert","computeAssertionName","obj","msg","to","be","a","name"],"sources":["should-to-assert.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\
|
|
1
|
+
{"version":3,"names":["require","isArray","camelCase","module","exports","shouldToAssert","chai","names","Assertion","keys","forEach","key","assert","computeAssertionName","obj","msg","to","be","a","name"],"sources":["should-to-assert.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nconst {isArray, camelCase} = require('lodash');\n\n/**\n * Converts expect/should assertion definitions into assert definitions\n * @param {Object} chai\n * @param {Object|Array} names if an Object, keys are should assertions and\n * values are assert assertions; if an array, values are should assertions and\n * assert assertions are computed by capitalizing the first letter and\n * prepending \"is\".\n * @returns {undefined}\n */\nmodule.exports = function shouldToAssert(chai, names) {\n const {Assertion} = chai;\n /* eslint no-unused-expressions: [0] */\n\n const keys = isArray(names) ? names : Object.keys(names);\n\n keys.forEach((key) => {\n chai.assert[computeAssertionName(key)] = (obj, msg) => {\n new Assertion(obj, msg).to.be.a[key];\n };\n });\n\n /**\n * @private\n * @param {string} key\n * @returns {string}\n */\n function computeAssertionName(key) {\n const name = names[key];\n\n if (name) {\n return name;\n }\n\n return camelCase(`is_${key}`);\n }\n};\n"],"mappings":";;;;AAAA;AACA;AACA;;AAEA,eAA6BA,OAAO,CAAC,QAAQ,CAAC;EAAvCC,OAAO,YAAPA,OAAO;EAAEC,SAAS,YAATA,SAAS;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAC,MAAM,CAACC,OAAO,GAAG,SAASC,cAAc,CAACC,IAAI,EAAEC,KAAK,EAAE;EACpD,IAAOC,SAAS,GAAIF,IAAI,CAAjBE,SAAS;EAChB;;EAEA,IAAMC,IAAI,GAAGR,OAAO,CAACM,KAAK,CAAC,GAAGA,KAAK,GAAG,mBAAYA,KAAK,CAAC;EAExDE,IAAI,CAACC,OAAO,CAAC,UAACC,GAAG,EAAK;IACpBL,IAAI,CAACM,MAAM,CAACC,oBAAoB,CAACF,GAAG,CAAC,CAAC,GAAG,UAACG,GAAG,EAAEC,GAAG,EAAK;MACrD,IAAIP,SAAS,CAACM,GAAG,EAAEC,GAAG,CAAC,CAACC,EAAE,CAACC,EAAE,CAACC,CAAC,CAACP,GAAG,CAAC;IACtC,CAAC;EACH,CAAC,CAAC;;EAEF;AACF;AACA;AACA;AACA;EACE,SAASE,oBAAoB,CAACF,GAAG,EAAE;IACjC,IAAMQ,IAAI,GAAGZ,KAAK,CAACI,GAAG,CAAC;IAEvB,IAAIQ,IAAI,EAAE;MACR,OAAOA,IAAI;IACb;IAEA,OAAOjB,SAAS,cAAOS,GAAG,EAAG;EAC/B;AACF,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,12 +3,10 @@
|
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
5
5
|
*/
|
|
6
|
-
var chai = require('chai');
|
|
7
6
|
|
|
7
|
+
var chai = require('chai');
|
|
8
8
|
var sinon = require('sinon');
|
|
9
|
-
|
|
10
9
|
var registerAssertions = require('./assertions');
|
|
11
|
-
|
|
12
10
|
chai.use(registerAssertions);
|
|
13
11
|
sinon.assert.expose(chai.assert, {
|
|
14
12
|
prefix: ''
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["chai","require","sinon","registerAssertions","use","assert","expose","prefix","module","exports"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\
|
|
1
|
+
{"version":3,"names":["chai","require","sinon","registerAssertions","use","assert","expose","prefix","module","exports"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nconst chai = require('chai');\nconst sinon = require('sinon');\n\nconst registerAssertions = require('./assertions');\n\nchai.use(registerAssertions);\nsinon.assert.expose(chai.assert, {prefix: ''});\n\nmodule.exports = chai;\n"],"mappings":";;AAAA;AACA;AACA;;AAEA,IAAMA,IAAI,GAAGC,OAAO,CAAC,MAAM,CAAC;AAC5B,IAAMC,KAAK,GAAGD,OAAO,CAAC,OAAO,CAAC;AAE9B,IAAME,kBAAkB,GAAGF,OAAO,CAAC,cAAc,CAAC;AAElDD,IAAI,CAACI,GAAG,CAACD,kBAAkB,CAAC;AAC5BD,KAAK,CAACG,MAAM,CAACC,MAAM,CAACN,IAAI,CAACK,MAAM,EAAE;EAACE,MAAM,EAAE;AAAE,CAAC,CAAC;AAE9CC,MAAM,CAACC,OAAO,GAAGT,IAAI"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/test-helper-chai",
|
|
3
|
-
"version": "2.37.
|
|
3
|
+
"version": "2.37.1",
|
|
4
4
|
"description": "chai extended with webex specific assertions",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"sinon": "^9.2.4"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@webex/test-helper-file": "2.37.
|
|
21
|
+
"@webex/test-helper-file": "2.37.1",
|
|
22
22
|
"check-error": "^1.0.2",
|
|
23
23
|
"lodash": "^4.17.21"
|
|
24
24
|
}
|
package/src/assertions/index.js
CHANGED
|
@@ -29,67 +29,70 @@ module.exports = function registerAssertions(chai) {
|
|
|
29
29
|
|
|
30
30
|
const promise = this.then ? this : this._obj;
|
|
31
31
|
|
|
32
|
-
return promise
|
|
33
|
-
|
|
34
|
-
(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (errorLike) {
|
|
49
|
-
if (errorLike
|
|
50
|
-
if (!checkError.compatibleInstance(reason, errorLike)) {
|
|
51
|
-
this.assert(
|
|
52
|
-
false,
|
|
53
|
-
'expected #{this} to be rejected with #{exp} but was rejected with #{act}',
|
|
54
|
-
null,
|
|
55
|
-
errorLike.toString(),
|
|
56
|
-
reason.toString()
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (!checkError.compatibleConstructor(reason, errorLike)) {
|
|
32
|
+
return promise.then(
|
|
33
|
+
(actual) => {
|
|
34
|
+
assert(
|
|
35
|
+
false,
|
|
36
|
+
'expected #{this} to be rejected but it was fulfilled with #{act}',
|
|
37
|
+
null,
|
|
38
|
+
errorLike && errorLike.toString(),
|
|
39
|
+
actual
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
return actual;
|
|
43
|
+
},
|
|
44
|
+
// complexity is result of basic ternaries
|
|
45
|
+
// eslint-disable-next-line complexity
|
|
46
|
+
function onReject(reason) {
|
|
47
|
+
if (errorLike) {
|
|
48
|
+
if (errorLike instanceof Error) {
|
|
49
|
+
if (!checkError.compatibleInstance(reason, errorLike)) {
|
|
62
50
|
this.assert(
|
|
63
51
|
false,
|
|
64
52
|
'expected #{this} to be rejected with #{exp} but was rejected with #{act}',
|
|
65
53
|
null,
|
|
66
|
-
errorLike
|
|
67
|
-
reason
|
|
54
|
+
errorLike.toString(),
|
|
55
|
+
reason.toString()
|
|
68
56
|
);
|
|
69
57
|
}
|
|
70
58
|
}
|
|
71
59
|
|
|
72
|
-
if (reason
|
|
73
|
-
|
|
60
|
+
if (!checkError.compatibleConstructor(reason, errorLike)) {
|
|
61
|
+
this.assert(
|
|
62
|
+
false,
|
|
63
|
+
'expected #{this} to be rejected with #{exp} but was rejected with #{act}',
|
|
64
|
+
null,
|
|
65
|
+
errorLike instanceof Error
|
|
66
|
+
? errorLike.toString()
|
|
67
|
+
: errorLike && checkError.getConstructorName(errorLike),
|
|
68
|
+
reason instanceof Error
|
|
69
|
+
? reason.toString()
|
|
70
|
+
: reason && checkError.getConstructorName(reason)
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
75
|
+
if (reason && errMsgMatcher) {
|
|
76
|
+
let placeholder = 'including';
|
|
78
77
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
false,
|
|
82
|
-
`expected #{this} to be be rejected with error ${placeholder} #{exp} but got #{act}`,
|
|
83
|
-
null,
|
|
84
|
-
errMsgMatcher,
|
|
85
|
-
checkError.getMessage(reason)
|
|
86
|
-
);
|
|
87
|
-
}
|
|
78
|
+
if (errMsgMatcher instanceof RegExp) {
|
|
79
|
+
placeholder = 'matching';
|
|
88
80
|
}
|
|
89
81
|
|
|
90
|
-
|
|
82
|
+
if (!checkError.compatibleMessage(reason, errMsgMatcher)) {
|
|
83
|
+
this.assert(
|
|
84
|
+
false,
|
|
85
|
+
`expected #{this} to be be rejected with error ${placeholder} #{exp} but got #{act}`,
|
|
86
|
+
null,
|
|
87
|
+
errMsgMatcher,
|
|
88
|
+
checkError.getMessage(reason)
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
91
|
}
|
|
92
|
-
|
|
92
|
+
|
|
93
|
+
return reason;
|
|
94
|
+
}
|
|
95
|
+
);
|
|
93
96
|
});
|
|
94
97
|
|
|
95
98
|
chai.assert.isRejected = function isRejected(promise, errorLike, errMsgMatcher, msg) {
|
|
@@ -98,7 +101,10 @@ module.exports = function registerAssertions(chai) {
|
|
|
98
101
|
errorLike = null;
|
|
99
102
|
}
|
|
100
103
|
|
|
101
|
-
return new Assertion(promise, msg, chai.assert.isRejected, true).to.be.rejectedWith(
|
|
104
|
+
return new Assertion(promise, msg, chai.assert.isRejected, true).to.be.rejectedWith(
|
|
105
|
+
errorLike,
|
|
106
|
+
errMsgMatcher
|
|
107
|
+
);
|
|
102
108
|
};
|
|
103
109
|
|
|
104
110
|
/* eslint no-unused-expressions: [0] */
|
|
@@ -24,17 +24,12 @@ module.exports = function schemas(chai) {
|
|
|
24
24
|
'expires_in',
|
|
25
25
|
'refresh_token',
|
|
26
26
|
'refresh_token_expires',
|
|
27
|
-
'refresh_token_expires_in'
|
|
27
|
+
'refresh_token_expires_in',
|
|
28
28
|
]);
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
Assertion.addProperty('Activity', function () {
|
|
32
|
-
assert.properties(this._obj, [
|
|
33
|
-
'url',
|
|
34
|
-
'id',
|
|
35
|
-
'object',
|
|
36
|
-
'actor'
|
|
37
|
-
]);
|
|
32
|
+
assert.properties(this._obj, ['url', 'id', 'object', 'actor']);
|
|
38
33
|
|
|
39
34
|
assert.equal(this._obj.objectType, 'activity');
|
|
40
35
|
});
|
|
@@ -42,12 +37,12 @@ module.exports = function schemas(chai) {
|
|
|
42
37
|
Assertion.addProperty('FileItem', function () {
|
|
43
38
|
assert.property(this._obj, 'displayName', 'The file has a display name');
|
|
44
39
|
assert.property(this._obj, 'scr', 'The file has an scr');
|
|
45
|
-
assert.property(this._obj.scr, 'loc',
|
|
40
|
+
assert.property(this._obj.scr, 'loc', "The file's scr has an loc");
|
|
46
41
|
});
|
|
47
42
|
|
|
48
43
|
Assertion.addProperty('ThumbnailItem', function () {
|
|
49
44
|
assert.property(this._obj, 'scr', 'The thumbnail has an scr');
|
|
50
|
-
assert.property(this._obj.scr, 'loc',
|
|
45
|
+
assert.property(this._obj.scr, 'loc', "The thumbnail's scr has an loc");
|
|
51
46
|
assert.property(this._obj, 'height', 'The thumbnail has a width');
|
|
52
47
|
assert.property(this._obj, 'width', 'The thumbnail has a width');
|
|
53
48
|
});
|
|
@@ -101,7 +96,10 @@ module.exports = function schemas(chai) {
|
|
|
101
96
|
assert.isConversation(this._obj);
|
|
102
97
|
assert.property(this._obj, 'team');
|
|
103
98
|
|
|
104
|
-
assert.ok(
|
|
99
|
+
assert.ok(
|
|
100
|
+
this._obj.tags.includes('OPEN') || this._obj.tags.includes('TEAM'),
|
|
101
|
+
'Conversation must have `OPEN` or `TEAM` tag'
|
|
102
|
+
);
|
|
105
103
|
|
|
106
104
|
assert.property(this._obj, 'encryptedDisplayName');
|
|
107
105
|
assert.property(this._obj, 'displayName');
|
|
@@ -138,7 +136,7 @@ module.exports = function schemas(chai) {
|
|
|
138
136
|
'personEmail',
|
|
139
137
|
'isModerator',
|
|
140
138
|
'isMonitor',
|
|
141
|
-
'created'
|
|
139
|
+
'created',
|
|
142
140
|
]);
|
|
143
141
|
|
|
144
142
|
assert.isHydraID(this._obj.id);
|
|
@@ -149,13 +147,7 @@ module.exports = function schemas(chai) {
|
|
|
149
147
|
});
|
|
150
148
|
|
|
151
149
|
Assertion.addProperty('Message', function () {
|
|
152
|
-
assert.properties(this._obj, [
|
|
153
|
-
'id',
|
|
154
|
-
'personId',
|
|
155
|
-
'personEmail',
|
|
156
|
-
'roomId',
|
|
157
|
-
'created'
|
|
158
|
-
]);
|
|
150
|
+
assert.properties(this._obj, ['id', 'personId', 'personEmail', 'roomId', 'created']);
|
|
159
151
|
|
|
160
152
|
assert.isString(this._obj.id);
|
|
161
153
|
assert.isHydraID(this._obj.personId);
|
|
@@ -182,11 +174,7 @@ module.exports = function schemas(chai) {
|
|
|
182
174
|
});
|
|
183
175
|
|
|
184
176
|
Assertion.addProperty('Person', function () {
|
|
185
|
-
assert.properties(this._obj, [
|
|
186
|
-
'id',
|
|
187
|
-
'emails',
|
|
188
|
-
'created'
|
|
189
|
-
]);
|
|
177
|
+
assert.properties(this._obj, ['id', 'emails', 'created']);
|
|
190
178
|
|
|
191
179
|
assert.isHydraID(this._obj.id);
|
|
192
180
|
assert.isArray(this._obj.emails);
|
|
@@ -205,11 +193,7 @@ module.exports = function schemas(chai) {
|
|
|
205
193
|
});
|
|
206
194
|
|
|
207
195
|
Assertion.addProperty('Room', function () {
|
|
208
|
-
assert.properties(this._obj, [
|
|
209
|
-
'id',
|
|
210
|
-
'title',
|
|
211
|
-
'created'
|
|
212
|
-
]);
|
|
196
|
+
assert.properties(this._obj, ['id', 'title', 'created']);
|
|
213
197
|
|
|
214
198
|
assert.isHydraID(this._obj.id);
|
|
215
199
|
assert.isString(this._obj.title);
|
|
@@ -217,11 +201,7 @@ module.exports = function schemas(chai) {
|
|
|
217
201
|
});
|
|
218
202
|
|
|
219
203
|
Assertion.addProperty('Team', function () {
|
|
220
|
-
assert.properties(this._obj, [
|
|
221
|
-
'id',
|
|
222
|
-
'name',
|
|
223
|
-
'created'
|
|
224
|
-
]);
|
|
204
|
+
assert.properties(this._obj, ['id', 'name', 'created']);
|
|
225
205
|
|
|
226
206
|
assert.isHydraID(this._obj.id);
|
|
227
207
|
assert.isString(this._obj.name);
|
|
@@ -235,7 +215,7 @@ module.exports = function schemas(chai) {
|
|
|
235
215
|
'personId',
|
|
236
216
|
'personEmail',
|
|
237
217
|
'isModerator',
|
|
238
|
-
'created'
|
|
218
|
+
'created',
|
|
239
219
|
]);
|
|
240
220
|
|
|
241
221
|
assert.isHydraID(this._obj.id);
|
|
@@ -252,14 +232,7 @@ module.exports = function schemas(chai) {
|
|
|
252
232
|
});
|
|
253
233
|
|
|
254
234
|
Assertion.addProperty('Webhook', function () {
|
|
255
|
-
assert.properties(this._obj, [
|
|
256
|
-
'id',
|
|
257
|
-
'resource',
|
|
258
|
-
'event',
|
|
259
|
-
'filter',
|
|
260
|
-
'targetUrl',
|
|
261
|
-
'name'
|
|
262
|
-
]);
|
|
235
|
+
assert.properties(this._obj, ['id', 'resource', 'event', 'filter', 'targetUrl', 'name']);
|
|
263
236
|
|
|
264
237
|
assert.isHydraID(this._obj.id);
|
|
265
238
|
assert.isString(this._obj.resource);
|
|
@@ -294,6 +267,6 @@ module.exports = function schemas(chai) {
|
|
|
294
267
|
'Team',
|
|
295
268
|
'TeamMembership',
|
|
296
269
|
'TeamRoom',
|
|
297
|
-
'Webhook'
|
|
270
|
+
'Webhook',
|
|
298
271
|
]);
|
|
299
272
|
};
|