Skip to content

Test: table-drive in-flight and terminal-status states for every form that POSTs #3396

Open

Description

@VijitSingh97

What's the problem

The dashboard's form tests cover the happy path and one failure per form. They do not hold a request in flight and they do not render every terminal result status. Two defects reached 2.0.0 release-candidate testing for that reason:

Both are fixed and closed, as are #3264 (an unsaved draft lost on a view switch) and #3353 (a rejected-preview error kept after Discard). The owner ruled on 2026-10-11 that every defect an RC cut finds must be caught by automated tests from then on. Those forms are being rebuilt in the Sovereign UI (#3566), so the same two defect classes can return in new code with nothing to stop them.

The original scope named old form modules and the old tab navigation. The current dashboard gets no more work (owner, 2026-10-27) and is deleted at the cutover (#2547), so that scope is superseded. This issue now covers the new forms only. It was parked on 2026-10-21 because tests written before v2.1.0 reshapes these forms would be rewritten, and the owner lifted the pause on parked work on 2026-10-27. It still cannot start until the forms exist.

What it impacts

How I found it

How important is it

Medium. It is test debt: it never blocks a ship and cannot start before the pages land. Cost is S per form and M overall, with seconds of CI runtime. It is worth doing because RC testing found these two defect classes by hand twice, in flows where a repeated restore or a false "saved" does real damage.

Acceptance criteria

Scope

  • Tests only, against the Sovereign UI, after the issues named above have landed. Nothing is added to or changed in the current dashboard frontend or its tests.
  • One table lists every form that POSTs, with its page and platforms per v2.1.0 lean UI spec: four pages, one profile control, an Advanced drawer #3566 sections D, E, F, G, H and J. It has at least: the preview-and-confirm commit (profile, XvB, electricity price, alerts), Back up now, Update Pithead, rig adopt or manage, Update all rigs, per-rig Update and Restart, Reboot and Power off (appliance only), the typed setup submit, and restore from backup (appliance wizard). A form hidden on a platform is skipped for that platform. A form added by a later page issue is one more row.

Terminal statuses

  • On appliance and DIY-with-login fixtures, each row renders every status its writer emits (pending with 202, previewed, applied, failed, rejected) plus a transport error. Text matches the status: a rejected result never says saved or applied and tells the user to preview again; a failed result never says applied; pending shows a busy state, not a result.

In flight

Proof and placement

  • Each case is shown red with its guard removed (the in-flight guard, the status-to-text mapping, the Discard clear) and green with it. The PR quotes the CI run ids of both.
  • Node cases and browser cases live in files the two required jobs already run. No new job, no new required check.
  • Fixtures use synthetic values only: no real address, token, passphrase or hostname in tests, fixtures or logs. No explanatory source comments.

Possible solutions

  • One table module in the frontend test tree, read by both suites: the node suite renders each status through the form's status-to-text path, the browser suite loops the rows with a held response. A new form is then one row (recommended). The alternative, each page PR adding its own rows, is cheaper per PR but leaves the cross-form guarantee unowned.
  • Read each form's reachable statuses from its host writer (the preview and approval writer, the worker-operations writer) rather than guessing.
  • If a rebuilt form turns out to lack its guard or shows the wrong wording, fix it in the owning page issue. Do not patch it here. A bounded fix to the test harness itself is fine.
  • To settle once the first page lands: whether the pages share one busy and terminal-state component (the shared preview-and-confirm dialog and pending-change bar in v2.1.0 lean UI spec: four pages, one profile control, an Advanced drawer #3566 suggest so), which decides how many rows need their own browser case.
Earlier scope, kept as evidence only (superseded 2026-10-27; do not implement from it)

What's the problem

Test debt from 2.0.0 RC testing, for 2.0.1 (owner, 2026-10-11: every defect an RC cut finds must be caught by automated tests going forward).

What slipped
UI tests cover the happy path and one failure per component, not in-flight states or every terminal result status.

  • Setup restore permits duplicate archive uploads while awaiting a response #3327 (found in RC3 testing): while the first /submit-restore is pending, Restore stays enabled and a second click sends a second archive POST. submitRestore sets submitting only after res.ok (dashboard/mining_dashboard/web/static/wizard/wizard.mjs:338); the typed setup path sets it before its fetch (:255). dashboard/tests/browser/restore.test.mjs answers at once with 400 or an abort and never holds the response.
  • Dashboard appliance UI says a stale, rejected Configuration change was saved #3376 (RC4): a stale commit the host rejects renders "saved but is not running" (dashboard/mining_dashboard/web/static/config/applyfailure.mjs:37-38); dashboard/tests/frontend/config/applyfailure.test.mjs feeds applyFailure only status failed (:44).

what it impacts

Where it runs
Tier-1 CI. Node cases: required "Frontend logic tests (node --test)". Playwright cases: required "Browser user journeys".

How I found it

Discovery details are not separately established in the existing report; preserve and verify the evidence already recorded.

how important is it

Cost
S per form, M overall. Seconds of runtime.

acceptance criteria

Done when

possible solutions

Test to build

  1. Node, in applyfailure.test.mjs and dashboard/tests/frontend/wizard/wizard-submit.test.mjs: for appliance true and false, render every status the writers emit (applied, failed, rejected and previewed in lib/pithead/43-control-approval-and-preview.sh through lib/pithead/46-control-worker-ops.sh; pending at dashboard/mining_dashboard/web/server.py:172) plus the client-made error (dashboard/mining_dashboard/web/static/workers/workeradopt.mjs:46). Text must match the status: a rejected result never says saved or applied, and says to preview again.
  2. Playwright, restore.test.mjs: hold /submit-restore in a fixture-server handler (dashboard/tests/browser/fixtures.mjs:36-40; page.route omits file bytes in WebKit). While held: busy state shown, button disabled, and click, forced click and Enter leave one POST. Release with 400: error shown, file and passphrase kept, a deliberate retry sends the second. Add a 202 case. Repeat hold, navigate-away-and-back and every close path for config commit, backup, OS update and worker operations; this also pins the fixed Dashboard configuration silently loses unsaved edits when switching views #3264 (draft survives a view switch) and Dashboard keeps rejected preview error after discarding clean config #3353 (Discard clears a rejected-preview error).

Activity

  1. added this to the v2.x - post-GA milestone on Oct 11, 2026
  2. added
    dashboard
    testing
    on Oct 11, 2026
  3. pithead-developer commented on Oct 21, 2026

    @pithead-developer
    Contributor

    Parked in Icebox under the lean roadmap (owner, 2026-10-21): this tests a surface that v2.1.0 reshapes, so writing it now means rewriting it; the feature PRs carry their own tests.

  4. added
    operator-action
    on Oct 27, 2026
  5. added
    blocked
    on Oct 27, 2026
  6. removed
    operator-action
    on Oct 27, 2026
  7. pithead-developer commented on Nov 16, 2026

    @pithead-developer
    Contributor

    Blocked on #2547.
    Blocked on #2530.
    Blocked on #2540.
    Blocked on #2543.

    Parked until the lean UI lands (see the park comment above). The native blocked-by links already hold it, and the tick removes blocked when every listed issue closes. It covers every view, so it now also waits for the cutover in #2547.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockeddashboardtesting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions