mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-05 10:24:05 +00:00
lint + prettier
This commit is contained in:
@@ -8,13 +8,14 @@
|
||||
*
|
||||
* These tests pin all three, plus the argument shape each hook is handed.
|
||||
*/
|
||||
import { describe, it, expect, vi } from 'vitest';
|
||||
import { expectRegisteredProvider } from '../../helpers/module-providers';
|
||||
import { PluginHooks } from '../../../src/nest/plugins/plugin-hooks.service';
|
||||
import { PluginsRuntimeModule } from '../../../src/nest/plugins/plugins-runtime.module';
|
||||
import { createTestPluginRegistry } from '../../../src/nest/plugins/host/rpc-kit/testing';
|
||||
import { HOOK_PERMISSION } from '../../../src/nest/plugins/protocol/envelope';
|
||||
import { PluginHooks } from '../../../src/nest/plugins/plugin-hooks.service';
|
||||
import type { PluginRuntimeService } from '../../../src/nest/plugins/plugin-runtime.service';
|
||||
import { PluginsRuntimeModule } from '../../../src/nest/plugins/plugins-runtime.module';
|
||||
import { HOOK_PERMISSION } from '../../../src/nest/plugins/protocol/envelope';
|
||||
import { expectRegisteredProvider } from '../../helpers/module-providers';
|
||||
|
||||
import { describe, it, expect, vi } from 'vitest';
|
||||
|
||||
type Invocation = [string, string, string, unknown[], number | undefined, number];
|
||||
|
||||
@@ -136,7 +137,14 @@ describe('PluginHooks contracts', () => {
|
||||
const { hooks: h, invokeHook } = hooks();
|
||||
const message = { event: 'trip_reminder', title: 't', body: 'b' };
|
||||
await h.sendNotification('p', message, { token: 'x' });
|
||||
expect(invokeHook).toHaveBeenCalledWith('p', 'notificationChannel', 'send', [message, { token: 'x' }], undefined, 8000);
|
||||
expect(invokeHook).toHaveBeenCalledWith(
|
||||
'p',
|
||||
'notificationChannel',
|
||||
'send',
|
||||
[message, { token: 'x' }],
|
||||
undefined,
|
||||
8000,
|
||||
);
|
||||
await h.testNotification('p', { token: 'x' });
|
||||
expect(invokeHook).toHaveBeenCalledWith('p', 'notificationChannel', 'test', [{ token: 'x' }], undefined, 8000);
|
||||
});
|
||||
@@ -156,7 +164,12 @@ describe('PluginHooks contracts', () => {
|
||||
// settings (a wheelchair profile), and gets 8s: long enough for an external index,
|
||||
// short enough that the chip shows its error instead of spinning.
|
||||
const { hooks: h, invokeHook } = hooks();
|
||||
const request = { category: 'trailheads', bounds: { south: 47, west: 11, north: 47.5, east: 11.5 }, lang: 'de', limit: 60 };
|
||||
const request = {
|
||||
category: 'trailheads',
|
||||
bounds: { south: 47, west: 11, north: 47.5, east: 11.5 },
|
||||
lang: 'de',
|
||||
limit: 60,
|
||||
};
|
||||
await h.categoryPois('p', request, 7);
|
||||
expect(invokeHook).toHaveBeenCalledWith('p', 'poiCategoryProvider', 'getPois', [request], 7, 8000);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user