28 lines
1.6 KiB
Markdown
28 lines
1.6 KiB
Markdown
# Plan: pkg/ui (3.8%)
|
|
|
|
## Existing
|
|
- `object_dataops_test.go` (indexes, views, sequences, scripts, domain assignment)
|
|
- Rules: `pkg/ui/ui_rules.md`
|
|
|
|
## Layers
|
|
|
|
| Layer | Files | Testable? | Approach |
|
|
|-------|-------|-----------|----------|
|
|
| Data ops | column_, relation_, domain_, schema_, table_, database_dataops.go | Yes, pure | CRUD tests per file: create, duplicate, update/rename, delete, not-found, bounds, UpdateDate side effects |
|
|
| Pure helpers | `sortedKeys`, `schemaLocations`, `tableLocations`, `getColumnNames`, `parseSkipTablesUI`, help-text getters | Yes | Table-driven |
|
|
| Kind definitions | `indexKind/viewKind/sequenceKind/scriptKind` | Yes | Assert row builders and form-to-model mapping without rendering |
|
|
| Load/save | `loadDatabase`, `saveDatabase`, `createNewDatabase`, `importAndMergeDatabase`, `performMerge` | Partly | Temp files from `tests/assets`; verify format dispatch and error paths; avoid UI dialogs |
|
|
| Screens | *_screens.go, dialogs.go, main_menu.go | Yes, via simulation | tview app on tcell SimulationScreen; inject key events; assert navigation, form submit mutates model, cancel leaves it unchanged, delete confirm paths |
|
|
|
|
## Order
|
|
1. Data ops (largest gain, no tview)
|
|
2. Pure helpers and kinds
|
|
3. Load/save logic
|
|
4. Screen tests on simulation screen (menu, lists, forms, confirm dialogs, load/save)
|
|
|
|
## Decision
|
|
- Screen smoke tests via tview simulation screen are in scope (tcell `SimulationScreen`); drive keys/events, assert no panic and expected state.
|
|
|
|
## Live DB cases (dbtest)
|
|
- Load/save and import-merge from a live pgsql source: `dbtest.sh up postgres`; skip when `RELSPEC_TEST_PG_CONN` unset.
|