-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugins.test.ts
More file actions
29 lines (27 loc) · 1.04 KB
/
plugins.test.ts
File metadata and controls
29 lines (27 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import assert from 'node:assert/strict';
import { init as initTestServer } from './helpers/testServer.ts';
import * as plugins from '../src/lib/plugins.ts';
describe('[PLGX] Plugins', () => {
before(async () => {
await initTestServer(); // will init plugins
});
it('[PLGP] Unit: get list of streams to create', async () => {
// only test sample plugin
const { streams, permissions } = plugins.requiredPermissionsAndStreams();
const permissionsSample = permissions.filter((p: Record<string, unknown>) => p.streamId === 'body-weight');
const streamsSample = streams.filter((s: Record<string, unknown>) => s.id === 'body-weight' || s.id === 'body');
assert.deepEqual({ permissionsSample, streamsSample }, {
permissionsSample: [
{
streamId: 'body-weight',
level: 'manage',
defaultName: 'Body Weight'
}
],
streamsSample: [
{ id: 'body', parentId: null, name: 'Body' },
{ id: 'body-weight', parentId: 'body', name: 'Body Weight' }
]
});
});
});