Terminal stays anchored bottom-right during resize
Cursor changes to nw-resize during drag
API Mocking Strategy
// Mock /api/chat for CI (no real LLM in test pod)
awaitpage.route('**/api/chat',asyncroute=>{constbody=JSON.stringify({response:'Mock LLM response',thinking:'Mock thinking'})awaitroute.fulfill({status: 200,body,contentType:'application/json'})})// Mock /api/exec for CI (no real kubectl)
awaitpage.route('**/api/exec',asyncroute=>{awaitroute.fulfill({status: 200,body:'NAME READY STATUS\npod1 1/1 Running'})})
Acceptance
Keyboard shortcut works on Chromium + Firefox + WebKit
Built-in commands return correct output
Mocked LLM/kubectl responses render correctly
Resize drag changes dimensions (verify via getBoundingClientRect)
## Parent
Ref: #5
Depends on: #6
## Objective
Test Interactive Terminal: keyboard shortcut, commands, LLM chat streaming, kubectl exec, resize drag handle.
## Components Under Test
- `components/InteractiveTerminal.tsx` — Terminal UI, commands, streaming, resize
- `lib/TerminalContext.tsx` — Open/close state
- `app/api/chat/route.ts` — LLM inference endpoint
- `app/api/exec/route.ts` — kubectl execution endpoint
## Test Cases
### Open/Close (`terminal.spec.ts`)
- [ ] Terminal hidden by default
- [ ] Cmd+K (Mac) / Ctrl+K (non-Mac) opens terminal
- [ ] Terminal panel visible after open
- [ ] Press Cmd+K again closes terminal
- [ ] "Ask Poimen" header button also opens terminal
### Built-in Commands
- [ ] Type `help` → shows help text with command list
- [ ] Type `about` → shows Rock Liang bio info
- [ ] Type `clear` or `/clear` → clears history
- [ ] Command history displays in scrollable area
- [ ] Input field auto-focuses when terminal opens
### LLM Chat (mock API for CI)
- [ ] Type a question → shows loading spinner
- [ ] Response streams in (verify text appears progressively)
- [ ] Thinking section shows if returned by API
- [ ] Markdown rendered in response (`react-markdown`)
- [ ] Multiple messages in history scroll correctly
### Kubectl Execution (mock API for CI)
- [ ] Type `! kubectl get pods` → calls /api/exec
- [ ] Non-kubectl commands after `!` show error message
- [ ] Response displays in terminal
- [ ] Streaming output works
### Resize
- [ ] Resize handle visible at top-left corner
- [ ] Drag resize handle changes terminal width + height
- [ ] Minimum size respected
- [ ] Terminal stays anchored bottom-right during resize
- [ ] Cursor changes to `nw-resize` during drag
## API Mocking Strategy
```ts
// Mock /api/chat for CI (no real LLM in test pod)
await page.route('**/api/chat', async route => {
const body = JSON.stringify({ response: 'Mock LLM response', thinking: 'Mock thinking' })
await route.fulfill({ status: 200, body, contentType: 'application/json' })
})
// Mock /api/exec for CI (no real kubectl)
await page.route('**/api/exec', async route => {
await route.fulfill({ status: 200, body: 'NAME READY STATUS\npod1 1/1 Running' })
})
```
## Acceptance
- Keyboard shortcut works on Chromium + Firefox + WebKit
- Built-in commands return correct output
- Mocked LLM/kubectl responses render correctly
- Resize drag changes dimensions (verify via `getBoundingClientRect`)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Parent
Ref: #5
Depends on: #6
Objective
Test Interactive Terminal: keyboard shortcut, commands, LLM chat streaming, kubectl exec, resize drag handle.
Components Under Test
components/InteractiveTerminal.tsx— Terminal UI, commands, streaming, resizelib/TerminalContext.tsx— Open/close stateapp/api/chat/route.ts— LLM inference endpointapp/api/exec/route.ts— kubectl execution endpointTest Cases
Open/Close (
terminal.spec.ts)Built-in Commands
help→ shows help text with command listabout→ shows Rock Liang bio infoclearor/clear→ clears historyLLM Chat (mock API for CI)
react-markdown)Kubectl Execution (mock API for CI)
! kubectl get pods→ calls /api/exec!show error messageResize
nw-resizeduring dragAPI Mocking Strategy
Acceptance
getBoundingClientRect)