adapt-authoring-roles 1.4.1 → 1.5.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/.github/workflows/standardjs.yml +2 -2
- package/lib/RolesModule.js +1 -2
- package/package.json +2 -2
- package/routes.json +3 -0
- package/tests/RolesModule.spec.js +0 -16
package/lib/RolesModule.js
CHANGED
|
@@ -96,10 +96,9 @@ class RolesModule extends AbstractApiModule {
|
|
|
96
96
|
|
|
97
97
|
/** @override */
|
|
98
98
|
async setValues () {
|
|
99
|
-
|
|
99
|
+
await super.setValues()
|
|
100
100
|
/** @ignore */ this.schemaName = 'role'
|
|
101
101
|
/** @ignore */ this.collectionName = 'roles'
|
|
102
|
-
this.useDefaultRouteConfig()
|
|
103
102
|
}
|
|
104
103
|
|
|
105
104
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adapt-authoring-roles",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Module for managing user roles",
|
|
5
5
|
"homepage": "https://github.com/adapt-security/adapt-authoring-roles",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
]
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"adapt-authoring-api": "^
|
|
47
|
+
"adapt-authoring-api": "^3.0.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"adapt-authoring-auth": "^2.0.0",
|
package/routes.json
ADDED
|
@@ -13,10 +13,8 @@ import assert from 'node:assert/strict'
|
|
|
13
13
|
/** Build a minimal RolesModule-like instance with sensible stub defaults */
|
|
14
14
|
function createInstance (overrides) {
|
|
15
15
|
const instance = {
|
|
16
|
-
root: undefined,
|
|
17
16
|
schemaName: undefined,
|
|
18
17
|
collectionName: undefined,
|
|
19
|
-
useDefaultRouteConfig: mock.fn(),
|
|
20
18
|
app: {
|
|
21
19
|
waitForModule: mock.fn(async () => ({})),
|
|
22
20
|
errors: {
|
|
@@ -46,10 +44,8 @@ function createInstance (overrides) {
|
|
|
46
44
|
// ── Method references (copied from source for isolated testing) ─────
|
|
47
45
|
|
|
48
46
|
async function setValues () {
|
|
49
|
-
this.root = 'roles'
|
|
50
47
|
this.schemaName = 'role'
|
|
51
48
|
this.collectionName = 'roles'
|
|
52
|
-
this.useDefaultRouteConfig()
|
|
53
49
|
}
|
|
54
50
|
|
|
55
51
|
async function getScopesForRole (_id) {
|
|
@@ -171,12 +167,6 @@ describe('RolesModule', () => {
|
|
|
171
167
|
// ── setValues ──────────────────────────────────────────────────────
|
|
172
168
|
|
|
173
169
|
describe('setValues', () => {
|
|
174
|
-
it('should set root to "roles"', async () => {
|
|
175
|
-
const inst = createInstance()
|
|
176
|
-
await setValues.call(inst)
|
|
177
|
-
assert.equal(inst.root, 'roles')
|
|
178
|
-
})
|
|
179
|
-
|
|
180
170
|
it('should set schemaName to "role"', async () => {
|
|
181
171
|
const inst = createInstance()
|
|
182
172
|
await setValues.call(inst)
|
|
@@ -188,12 +178,6 @@ describe('RolesModule', () => {
|
|
|
188
178
|
await setValues.call(inst)
|
|
189
179
|
assert.equal(inst.collectionName, 'roles')
|
|
190
180
|
})
|
|
191
|
-
|
|
192
|
-
it('should call useDefaultRouteConfig', async () => {
|
|
193
|
-
const inst = createInstance()
|
|
194
|
-
await setValues.call(inst)
|
|
195
|
-
assert.equal(inst.useDefaultRouteConfig.mock.callCount(), 1)
|
|
196
|
-
})
|
|
197
181
|
})
|
|
198
182
|
|
|
199
183
|
// ── getScopesForRole ───────────────────────────────────────────────
|