From 33d8cb706922af9c16f26356bb6d44dd0788c41d Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Sat, 27 Dec 2025 17:40:00 -0800 Subject: [PATCH] test: deflake templates locale coverage (#7705) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Ensure the templates locale Playwright test validates localized UI text instead of waiting on a flaky network request. ## Changes - **What**: Update `Templates >> Uses proper locale files for templates` to assert on French strings rendered in the dialog and confirm English fallback is absent ## Review Focus - Confirm the chosen French strings always appear when the localized bundle loads so the test meaningfully covers the regression ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7705-test-deflake-templates-locale-coverage-2d16d73d365081ffbf9adc1623a36733) by [Unito](https://www.unito.io) --- browser_tests/tests/templates.spec.ts | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/browser_tests/tests/templates.spec.ts b/browser_tests/tests/templates.spec.ts index 730acc749..5e66054a0 100644 --- a/browser_tests/tests/templates.spec.ts +++ b/browser_tests/tests/templates.spec.ts @@ -109,22 +109,27 @@ test.describe('Templates', () => { }) test('Uses proper locale files for templates', async ({ comfyPage }) => { - // Load the templates dialog and wait for the French index file request - const requestPromise = comfyPage.page.waitForRequest( - '**/templates/index.fr.json' - ) - - // Set locale to French before opening templates await comfyPage.setSetting('Comfy.Locale', 'fr') await comfyPage.executeCommand('Comfy.BrowseTemplates') - const request = await requestPromise + const dialog = comfyPage.page.getByRole('dialog').filter({ + has: comfyPage.page.getByRole('heading', { name: 'Modèles', exact: true }) + }) + await expect(dialog).toBeVisible() - // Verify French index was requested - expect(request.url()).toContain('templates/index.fr.json') + // Validate that French-localized strings from the templates index are rendered + await expect( + dialog.getByRole('heading', { name: 'Modèles', exact: true }) + ).toBeVisible() + await expect( + dialog.getByRole('button', { name: 'Tous les modèles', exact: true }) + ).toBeVisible() - await expect(comfyPage.templates.content).toBeVisible() + // Ensure the English fallback copy is not shown anywhere + await expect( + comfyPage.page.getByText('All Templates', { exact: true }) + ).toHaveCount(0) }) test('Falls back to English templates when locale file not found', async ({