Skip to content

fix(react-ui): force .check() on hidden Toggle input in fits-filter e2e#10031

Merged
mudler merged 2 commits into
masterfrom
fix/e2e-fits-toggle-force-check
May 27, 2026
Merged

fix(react-ui): force .check() on hidden Toggle input in fits-filter e2e#10031
mudler merged 2 commits into
masterfrom
fix/e2e-fits-toggle-force-check

Conversation

@localai-bot
Copy link
Copy Markdown
Collaborator

Summary

The polish PR (#10030) swapped the raw <input type="checkbox"> for the shared <Toggle> component, which visually hides its native input via opacity: 0; width: 0; height: 0. Playwright's .check() waits for the element to be visible and times out after 30s, breaking two UI E2E tests on master:

  • enabling fits filter hides models that exceed available VRAM
  • fits filter state persists after reload

This pass { force: true } so Playwright clicks the underlying real checkbox without the visibility wait. The companion .toBeChecked() assertion only reads state, so it works unchanged.

CI run that surfaced this: https://github.com/mudler/LocalAI/actions/runs/26532803286

Test plan

  • UI E2E Tests workflow runs green on the PR
  • enabling fits filter hides models that exceed available VRAM passes
  • fits filter state persists after reload passes

mudler added 2 commits May 27, 2026 20:06
The polish PR (#10030) swapped the raw <input type=checkbox> for the
shared <Toggle> component, which visually hides its native input via
opacity:0;width:0;height:0. Playwright's .check() waits for visibility
before clicking and times out after 30 s, breaking two UI E2E tests:

  - enabling fits filter hides models that exceed available VRAM
  - fits filter state persists after reload

Pass { force: true } to skip the visibility check; the input is still
the real focusable checkbox and toggles state on click. The companion
.toBeChecked() assertion only reads state and works unchanged.

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Assisted-by: Claude:claude-opus-4-7
force:true skips the actionability checks but not the viewport check,
and the Toggle's hidden input has width:0;height:0 so Playwright still
reports "Element is outside of the viewport". Click the visible
.toggle__track inside the filter-bar-group__toggle wrapper instead —
that's what a real user clicks, and label-input association toggles
the wrapped checkbox naturally.

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Assisted-by: Claude:claude-opus-4-7
@mudler mudler merged commit 373dc44 into master May 27, 2026
58 checks passed
@mudler mudler deleted the fix/e2e-fits-toggle-force-check branch May 27, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants