From 373dc449923ee57e296802298fa35bfb67e6268a Mon Sep 17 00:00:00 2001
From: "LocalAI [bot]" <139863280+localai-bot@users.noreply.github.com>
Date: Wed, 27 May 2026 22:41:01 +0200
Subject: [PATCH] fix(react-ui): force .check() on hidden Toggle input in
fits-filter e2e (#10031)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix(react-ui): force .check() on hidden Toggle input in fits-filter e2e
The polish PR (#10030) swapped the raw for the
shared 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
Assisted-by: Claude:claude-opus-4-7
* fix(react-ui): click visible Toggle track in fits-filter e2e
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
Assisted-by: Claude:claude-opus-4-7
---------
Signed-off-by: Ettore Di Giacinto
Co-authored-by: Ettore Di Giacinto
---
core/http/react-ui/e2e/models-gallery.spec.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/core/http/react-ui/e2e/models-gallery.spec.js b/core/http/react-ui/e2e/models-gallery.spec.js
index 8b3157635..242a6d621 100644
--- a/core/http/react-ui/e2e/models-gallery.spec.js
+++ b/core/http/react-ui/e2e/models-gallery.spec.js
@@ -289,7 +289,9 @@ test.describe('Models Gallery - Fits In GPU Filter', () => {
test('enabling fits filter hides models that exceed available VRAM', async ({ page }) => {
await expect(page.locator('tr', { hasText: 'stablediffusion-model' })).toBeVisible()
- await page.getByLabel('Fits in GPU').check()
+ // The shared visually hides its native input (opacity:0;w:0;h:0),
+ // so .check() can't interact with it directly — click the visible track.
+ await page.locator('label.filter-bar-group__toggle', { hasText: 'Fits in GPU' }).locator('.toggle__track').click()
await expect(page.locator('tr', { hasText: 'stablediffusion-model' })).toHaveCount(0)
await expect(page.locator('tr', { hasText: 'llama-model' })).toBeVisible()
@@ -298,7 +300,7 @@ test.describe('Models Gallery - Fits In GPU Filter', () => {
})
test('fits filter state persists after reload', async ({ page }) => {
- await page.getByLabel('Fits in GPU').check()
+ await page.locator('label.filter-bar-group__toggle', { hasText: 'Fits in GPU' }).locator('.toggle__track').click()
await page.reload()
await expect(page.getByLabel('Fits in GPU')).toBeChecked()
})