# E2E Test Coverage Gaps — From Production Use

> This file documents gaps between the upstream E2E test suite (PR #348) and
> real-world features/bugfixes discovered through production use in the origin fork.
>
> **58 commits** diverge from upstream. After excluding dev sessions/portal (9),
> infrastructure (3), and chores/docs (5), **31 commits** represent features and
> bug fixes that need E2E coverage.

---

## Priority Legend

| Priority | Meaning |
|----------|---------|
| **P0** | Core functionality; users will hit this daily |
| **P1** | Important feature or regression that affects data quality |
| **P2** | Enhancement or edge case; important but not blocking |
| **P3** | Nice-to-have; low frequency or low impact |

---

## Group A: Page Layouts (13 commits) — NO E2E COVERAGE — P0

Commits: `8ee2b06`, `821347d`, `bceeb44`, `aad0194`, `44abd18`, `dae1673`,
`f8f7d14`, `65cf266`, `1e46f00`, `759e075`, `6f0564f`

Page layouts are the foundation of how records are displayed and created.
**No existing E2E test covers layout-driven behavior.**

### Tests Needed

| Test scenario | Priority | Notes |
|---|---|---|
| Layout editor: create new layout for object | P0 | `/setup/objects` → select object → Layouts tab |
| Layout editor: add/remove fields from sections | P0 | Drag fields between Available and Section |
| Layout editor: set layout as default | P0 | Toggle default, verify it applies to new records |
| Layout editor: delete non-default layout | P1 | Confirm delete, verify removal |
| Record create form respects layout sections | P0 | Create record → form shows sections from layout, not flat grid |
| List view columns match `listFields` metadata | P0 | Save listFields, reload page, verify columns |
| Compact view / highlights panel shows correct fields | P1 | Record detail → highlights panel uses compact layout fields |
| Related lists render with correct counts | P1 | Record detail → related lists lazy-load, show counts |
| Related list navigation works without duplicate keys | P1 | Click related list item → navigate, no React key errors |
| Lookup display fields with dot-notation render | P2 | `Account.Owner.Name` shows owner name, not just ID |
| Multi-layout management: multiple layouts per object | P1 | Create 2+ layouts, verify both appear in layout list |

### Existing Tests Affected

`accounts-crud.spec.ts`, `contacts-crud.spec.ts`, `opportunities-crud.spec.ts` assume
flat form structure. When layouts are active, forms are organized in sections with
field ordering controlled by the layout. These tests' create/edit flows need
adaptation notes.

---

## Group B: Flows & Record-Triggered Automation (4 commits) — PARTIALLY COVERED — P1

Commits: `e4a947a`, `685d33d`, `bdbcace`, `b01898b`

### Existing Coverage

`flows.spec.ts` covers: flow list view, flow builder canvas, create/save/activate/
deactivate flow, element connections.

### Additional Tests Needed

| Test scenario | Priority | Notes |
|---|---|---|
| Record-triggered flow fires on record create | P0 | Create Account → before-save flow fires → side effect visible |
| Record-triggered flow fires on record update | P0 | Edit field → flow triggers → verify side effect |
| RecordLookup with no match returns null (IsNull=true) | P1 | Flow with RecordLookup → no matching record → null path taken |
| Entry conditions with `IsChanged` operator | P1 | Only fire when specific field changes |
| Complex FilterLogic: `1 AND (2 OR 3 OR 4 OR 5)` | P2 | Multi-condition with mixed AND/OR |
| CustomError element blocks before-save | P1 | Flow raises error → record save blocked → error visible to user |
| Validation skip on unchanged fields during update | P1 | Record with pre-existing invalid data → edit unrelated field → save succeeds |

---

## Group C: Validation Rules (1 commit) — NO E2E COVERAGE — P1

Commit: `df69d27`

### Tests Needed

| Test scenario | Priority | Notes |
|---|---|---|
| Create validation rule via Setup UI | P0 | `/setup/objects` → object → Validation Rules tab → New |
| View validation rules list | P1 | List shows rule name, condition, active status |
| Edit existing validation rule | P1 | Change condition, save, verify |
| Delete validation rule | P2 | Confirm delete, verify removal |
| Validation rule fires on record save | P0 | Create rule → create record violating rule → error message shown |
| Validation rule does NOT fire on unchanged fields | P1 | Pre-existing invalid data → edit unrelated field → save succeeds |

---

## Group D: Record CRUD & Display Fixes (6 commits) — PARTIALLY COVERED — P1

Commits: `5f3c6eb`, `8a13d60`, `e65af33`, `d7fe946`, `8085728`, `f17863d`, `b01898b`

### Existing Coverage

CRUD specs cover basic create/edit/delete lifecycle.

### Regression Tests Needed

| Test scenario | Priority | Notes |
|---|---|---|
| Multipicklist field renders as colored badges | P1 | Not raw JSON `["AWS","GCP"]` |
| Currency/percent fields display without trailing zeros | P1 | `$50,000.00` not `$50000.000000000000000000000000000000` |
| Picklist dropdown not clipped by parent overflow | P1 | Dropdown fully visible when opened near container edge |
| Field labels display correctly | P1 | Show configured label, not API name title-cased |
| Picklist options show single text | P1 | Not doubled like `"Awareness · Awareness"` |
| Picklist stores both value and label in Options | P1 | Select picklist → save → re-open → correct label shown |

---

## Group E: Server-Side Pagination (1 commit) — INADEQUATE COVERAGE — P1

Commit: `8883d43`

### Existing Coverage

`accounts-crud.spec.ts` has 1 basic pagination visibility check.

### Additional Tests Needed

| Test scenario | Priority | Notes |
|---|---|---|
| Page size selector changes visible rows | P0 | Select 20/50/100 → row count changes |
| Next/previous page navigation | P0 | Click next → different records shown |
| Specific page navigation | P2 | Click page number → correct page shown |
| Total record count displayed | P1 | Shows "Showing 1-20 of 150" |
| Pagination state preserved after detail view | P2 | Go to page 3 → click record → back → still page 3 |

---

## Group F: Formula DSL Engine (1 commit) — NO E2E COVERAGE — P2

Commit: `fee314a`

### Tests Needed

| Test scenario | Priority | Notes |
|---|---|---|
| Create formula field in Object Manager | P1 | Field wizard → select Formula type → enter formula |
| Formula syntax highlighting in FormulaEditor | P2 | `data-testid="formula-editor"` exists in frontend |
| Record list displays computed formula values | P1 | Formula field column shows computed result |
| Record detail displays formula value | P1 | Detail page shows formula result |
| Formula with cross-object reference | P2 | `Account.Owner.Name` or similar resolves |

---

## Group G: Approvals Fixes (2 commits) — PARTIALLY COVERED — P2

Commits: `f9924bc`, `ed24df8`

### Existing Coverage

`approvals.spec.ts` and `approval-queue.spec.ts` cover basic CRUD and queue.

### Regression Tests Needed

| Test scenario | Priority | Notes |
|---|---|---|
| Pending approvals load without 404 errors | P1 | Tooling API metadata types filtered from REST lookups |
| Approval queue handles metadata type TableEnumOrId | P2 | No error when ProcessDefinition references metadata types |

---

## Group H: Auth & Security (2 commits) — PARTIALLY COVERED — P2

Commits: `8316f9f`, `454b6ac`

### Existing Coverage

`auth.spec.ts` covers login/logout flow.

### Regression Tests Needed

| Test scenario | Priority | Notes |
|---|---|---|
| Password preserved across server restart | P1 | Bootstrap doesn't overwrite bcrypt hash |
| CSRF protection on mutating endpoints | P2 | POST without CSRF token → 403 |

---

## Group I: App Launcher Fix (1 commit) — NO E2E COVERAGE — P2

Commit: `6a59020`

### Tests Needed

| Test scenario | Priority | Notes |
|---|---|---|
| App Launcher shows no duplicate entries | P1 | Open app launcher → each app appears once |
| Single app detail loads | P2 | Navigate to app detail page → renders correctly |

---

## Summary Table

| Group | Area | Commits | Existing Coverage | Gap | Priority |
|---|---|---|---|---|---|
| A | Page Layouts | 13 | None | Full suite needed | P0 |
| B | Flows / Automation | 4 | Basic list/builder | Record-triggered, null, IsChanged | P1 |
| C | Validation Rules | 1 | None | CRUD + execution | P1 |
| D | Record Display | 6 | Basic CRUD | Multipicklist, currency, labels | P1 |
| E | Pagination | 1 | 1 basic test | Page size, nav, count | P1 |
| F | Formula Engine | 1 | None | Field creation + display | P2 |
| G | Approvals Fixes | 2 | Basic flow | Sidebar 404, metadata types | P2 |
| H | Auth / Security | 2 | Login/logout | Bootstrap password, CSRF | P2 |
| I | App Launcher | 1 | None | Dedup test | P2 |
| — | Dev Sessions | 9 | None | **EXCLUDED** (internal) | — |
| — | Infra / Deploy | 3 | None | **EXCLUDED** (internal) | — |
| — | Chores / Docs | 5 | N/A | No tests needed | — |

**Total new test scenarios needed**: ~45 across 9 groups
**Highest priority**: Groups A (layouts), B (flows), C (validation), D (display), E (pagination)
