chore: import DH V2 D5.6.4 production baseline
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { strict as assert } from 'node:assert';
|
||||
import test from 'node:test';
|
||||
import 'reflect-metadata';
|
||||
import { REQUIRED_PERMISSIONS_KEY } from '../../src/authorization/decorators/require-permissions.decorator';
|
||||
import { DashboardController } from '../../src/dashboard/dashboard.controller';
|
||||
|
||||
test('dashboard summary requires dashboard.read', () => {
|
||||
const permissions = Reflect.getMetadata(
|
||||
REQUIRED_PERMISSIONS_KEY,
|
||||
DashboardController.prototype.summary,
|
||||
);
|
||||
assert.deepEqual(permissions, ['dashboard.read']);
|
||||
});
|
||||
|
||||
test('dashboard controller delegates summary', async () => {
|
||||
const expected = { counts: {}, recentAudit: [] };
|
||||
const controller = new DashboardController({
|
||||
summary: async () => expected,
|
||||
} as never);
|
||||
assert.equal(await controller.summary(), expected);
|
||||
});
|
||||
Reference in New Issue
Block a user