Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/RolesModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,9 @@ class RolesModule extends AbstractApiModule {

/** @override */
async setValues () {
/** @ignore */ this.root = 'roles'
await super.setValues()
/** @ignore */ this.schemaName = 'role'
/** @ignore */ this.collectionName = 'roles'
this.useDefaultRouteConfig()
}

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
]
},
"dependencies": {
"adapt-authoring-api": "^2.0.0"
"adapt-authoring-api": "^3.0.0"
},
"peerDependencies": {
"adapt-authoring-auth": "^2.0.0",
Expand Down
3 changes: 3 additions & 0 deletions routes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"root": "roles"
}
16 changes: 0 additions & 16 deletions tests/RolesModule.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ import assert from 'node:assert/strict'
/** Build a minimal RolesModule-like instance with sensible stub defaults */
function createInstance (overrides) {
const instance = {
root: undefined,
schemaName: undefined,
collectionName: undefined,
useDefaultRouteConfig: mock.fn(),
app: {
waitForModule: mock.fn(async () => ({})),
errors: {
Expand Down Expand Up @@ -46,10 +44,8 @@ function createInstance (overrides) {
// ── Method references (copied from source for isolated testing) ─────

async function setValues () {
this.root = 'roles'
this.schemaName = 'role'
this.collectionName = 'roles'
this.useDefaultRouteConfig()
}

async function getScopesForRole (_id) {
Expand Down Expand Up @@ -171,12 +167,6 @@ describe('RolesModule', () => {
// ── setValues ──────────────────────────────────────────────────────

describe('setValues', () => {
it('should set root to "roles"', async () => {
const inst = createInstance()
await setValues.call(inst)
assert.equal(inst.root, 'roles')
})

it('should set schemaName to "role"', async () => {
const inst = createInstance()
await setValues.call(inst)
Expand All @@ -188,12 +178,6 @@ describe('RolesModule', () => {
await setValues.call(inst)
assert.equal(inst.collectionName, 'roles')
})

it('should call useDefaultRouteConfig', async () => {
const inst = createInstance()
await setValues.call(inst)
assert.equal(inst.useDefaultRouteConfig.mock.callCount(), 1)
})
})

// ── getScopesForRole ───────────────────────────────────────────────
Expand Down