---
id: w5/m6/t006
title: Test coverage
worker: worker5
status: done
estimate: 30m
depends_on: [w5/m6/t004]
---

## Objective

Add meaningful tests for m6: the `logs` query → line mapping (incl. text filter), and the live-tail buffer/reconnect behavior (append, dedupe against history, cap the buffer, handle a dropped stream). Assert real behavior and failure modes; no snapshot-everything tests.

## Context

- Test convention: adjacent `__tests__` dirs; vitest setup in `src/test/`.
- SSE: mock the `EventSource`/stream reader to drive append + disconnect paths deterministically.

## Steps

1. Test `LogEntry` → line mapping and the text-filter arg wiring.
2. Test `useLiveLogs`: appends streamed lines, dedupes against historical, caps the buffer, surfaces a disconnect.

## Files

- `src/features/logs/**/__tests__/*.test.ts(x)`

## Acceptance criteria

- [ ] Tests assert log mapping/filtering and the live-tail buffer + reconnect behavior.
- [ ] `yarn test` passes.

## Out of scope

- Live prod verification (t004 covers it manually).
