mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
refactor: extract sanitizeForTestId to shared utility
Address PR review comments by: - Creating shared sanitizeForTestId utility in apps/ui/src/lib/utils.ts - Updating ProjectSwitcherItem to use the shared utility - Adding matching helper to test utils for E2E tests - Updating all E2E tests to use the sanitization helper This ensures the component and tests use identical sanitization logic, making tests robust against project names with special characters.
This commit is contained in:
@@ -21,6 +21,7 @@ import {
|
||||
getKanbanColumn,
|
||||
authenticateForTests,
|
||||
handleLoginScreenIfPresent,
|
||||
sanitizeForTestId,
|
||||
} from '../utils';
|
||||
|
||||
const TEST_TEMP_DIR = createTempDirPath('manual-review-test');
|
||||
@@ -132,7 +133,8 @@ test.describe('Feature Manual Review Flow', () => {
|
||||
|
||||
// Verify we're on the correct project (project switcher button shows project name)
|
||||
// Use ends-with selector since data-testid format is: project-switcher-{id}-{sanitizedName}
|
||||
await expect(page.locator(`[data-testid$="-${projectName}"]`)).toBeVisible({
|
||||
const sanitizedProjectName = sanitizeForTestId(projectName);
|
||||
await expect(page.locator(`[data-testid$="-${sanitizedProjectName}"]`)).toBeVisible({
|
||||
timeout: 10000,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user