Skip to content

GUI: unit-test PullControl device-aware logic #64

Description

@matt-pharr

Problem

PR #52 made PullControl device-aware (a useEffect snaps backend / sensor-set / window / shot to per-device defaults; hides remote/auto and the "by analysis" option for tree devices; genericized the credential copy). None of this is covered by a frontend test — api.test.ts wasn't updated for the new DeviceInfo fields and there is no PullControl.test.tsx, even though the repo has ~24 frontend tests.

Suggested fix

  • Extract the "defaults for the selected device" decision (backend / sensor-set / tmin / tmax / shot from access / remote_capable / default_shot) into a pure helper and unit-test the tree-vs-ptdata branches.
  • Add an api.test.ts case asserting fetchDevices() round-trips the optional fields (access, remote_capable, default_shot).

Where

  • gui/web/src/components/PullControl.tsx (the device-change effect), gui/web/src/lib/api.ts (DeviceInfo).

Context

Found in the PR #52 review (feature/nstxu-data-fetch).

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions