@bluedot-innovation/models 10.10.1 → 10.11.0
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/CHANGELOG.md
CHANGED
|
@@ -102,6 +102,18 @@ testCase('Account', () => {
|
|
|
102
102
|
assert.match(err.message, /`Invalid` is not a valid enum value for path `type`/)
|
|
103
103
|
}
|
|
104
104
|
})
|
|
105
|
+
|
|
106
|
+
assertions('should throw an error when Account has invalid Hello stack', async () => {
|
|
107
|
+
let Account = new AccountModel(account)
|
|
108
|
+
Account.features.helloStack.name = "Invalid"
|
|
109
|
+
try {
|
|
110
|
+
await Account.validate()
|
|
111
|
+
} catch (err) {
|
|
112
|
+
assert.exists(err, 'err object should exist')
|
|
113
|
+
assert.isObject(err.errors)
|
|
114
|
+
assert.match(err.message, /`Invalid` is not a valid enum value for path `name`/)
|
|
115
|
+
}
|
|
116
|
+
})
|
|
105
117
|
})
|
|
106
118
|
|
|
107
119
|
testCase('recursive invalid entry check', () => {
|
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ let AccountScreensSchema = require('./AccountScreens')
|
|
|
5
5
|
let AccountCemdPersistenceSchema = require('./AccountCemdPersistence')
|
|
6
6
|
let HelloSsoSchema = require('./HelloSso')
|
|
7
7
|
const CanvasSsoSchema = require('./CanvasSsoFeature')
|
|
8
|
+
const HelloStackSchema = require('./HelloStackFeature')
|
|
8
9
|
|
|
9
10
|
function helloSsoValidator (value) {
|
|
10
11
|
const { enabled, identityProvider, dashboardIdentityProvider } = value
|
|
@@ -26,6 +27,7 @@ let AccountFeaturesSchema = new mongoose.Schema({
|
|
|
26
27
|
helloSso: { type: HelloSsoSchema, validate: { validator: helloSsoValidator, msg: 'When the feature is enbaled, at leat one of provider need to be provided.' } },
|
|
27
28
|
canvasSso: CanvasSsoSchema,
|
|
28
29
|
helloStateTemplates: AccountBasicFeatureSchema,
|
|
30
|
+
helloStack: HelloStackSchema
|
|
29
31
|
}, {
|
|
30
32
|
_id: false
|
|
31
33
|
})
|