Skip to content

test(ui): cover FileBrowser navigation and async states #124

Description

@zachdunn

Problem

@uploads/ui/FileBrowser, introduced in #122, is now a reusable asynchronous navigation component but has no focused interaction tests. During review, a stale-response/navigation bug was found where rows from the previous folder could appear under a new breadcrumb. The implementation now guards that case, but the behavior is not protected against regression.

Scope

Add component-level tests around the Files SDK client contract and user-visible navigation states. Prefer deterministic deferred promises/fake results over network integration tests.

Acceptance criteria

  • Root listing renders files and folder prefixes with accessible controls.
  • Folder navigation and breadcrumb navigation request the correct prefix and clear stale rows immediately.
  • A late response from a previous folder cannot overwrite the current folder.
  • Failed navigation displays the folder-scoped error state without retaining clickable rows from the previous folder.
  • Empty and loading states are covered.
  • Cursor pagination appends results without duplicating folder prefixes.
  • Selecting a file calls onSelect; rows are non-actionable when no selection handler is supplied.
  • Basic keyboard/accessibility assertions cover navigation labels and control semantics.

Context

Follow-up to #122. Keep account-specific authenticated endpoint behavior in API/web tests; this issue is for the shared UI component contract.

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