also looking at this
fix(dashboard): stop remote commands importing an absent config module
#59
5 files
+114
-0
| @@ -0,0 +1,24 @@ | ||
| 1 | import { describe, expect, it } from 'bun:test' | |
| 2 | import RemoteCommandIndexAction from '../../app/Actions/Dashboard/Remote/RemoteCommandIndexAction' | |
| 3 | import RemoteCommandRunAction from '../../app/Actions/Dashboard/Remote/RemoteCommandRunAction' | |
| 4 | ||
| 5 | describe('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 | }) | |