ReviewOS

also looking at this

stacks/analyticshq

fix(dashboard): stop remote commands importing an absent config module

#59
Merged glennmichael123 wants to merge fix/analyticshq-remote-and-subscribers into main
5 files +114 -0
tests/unit/remote-command-actions.test.tsadded+24-0
Changes to tests/unit/remote-command-actions.test.ts
@@ -0,0 +1,24 @@
1import { describe, expect, it } from 'bun:test'
2import RemoteCommandIndexAction from '../../app/Actions/Dashboard/Remote/RemoteCommandIndexAction'
3import RemoteCommandRunAction from '../../app/Actions/Dashboard/Remote/RemoteCommandRunAction'
4
5describe('dashboard remote commands', () => {
6 it('loads without the optional framework remote config alias', async () => {
7 const result = await RemoteCommandIndexAction.handle()
8
9 expect(result.status).toBe(200)
10 expect(await result.json()).toEqual({
11 hosts: [],
12 commands: [],
13 })
14 })
15
16 it('fails closed when a remote command run is requested', async () => {
17 const result = await RemoteCommandRunAction.handle()
18
19 expect(result.status).toBe(403)
20 expect(await result.json()).toEqual({
21 message: 'Remote commands are not configured for AnalyticsHQ.',
22 })
23 })
24})