diff --git a/lib/RolesModule.js b/lib/RolesModule.js index 22207b8..fae050a 100644 --- a/lib/RolesModule.js +++ b/lib/RolesModule.js @@ -96,10 +96,8 @@ class RolesModule extends AbstractApiModule { /** @override */ async setValues () { - /** @ignore */ this.root = 'roles' /** @ignore */ this.schemaName = 'role' /** @ignore */ this.collectionName = 'roles' - this.useDefaultRouteConfig() } /** diff --git a/routes.json b/routes.json new file mode 100644 index 0000000..966d52a --- /dev/null +++ b/routes.json @@ -0,0 +1,3 @@ +{ + "root": "roles" +} diff --git a/tests/RolesModule.spec.js b/tests/RolesModule.spec.js index 4a70622..897d5c4 100644 --- a/tests/RolesModule.spec.js +++ b/tests/RolesModule.spec.js @@ -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: { @@ -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) { @@ -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) @@ -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 ───────────────────────────────────────────────