mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-18 22:33:08 +00:00
Make memory and context views mobile-friendly (#813)
* Changes from fix/memory-and-context-mobile-friendly * fix: Improve file extension detection and add path traversal protection * refactor: Extract file extension utilities and add path traversal guards Code review improvements: - Extract isMarkdownFilename and isImageFilename to shared image-utils.ts - Remove duplicated code from context-view.tsx and memory-view.tsx - Add path traversal guard for context fixture utilities (matching memory) - Add 7 new tests for context fixture path traversal protection - Total 61 tests pass Addresses code review feedback from PR #813 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test: Add e2e tests for profiles crud and board background persistence * Update apps/ui/playwright.config.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: Add robust test navigation handling and file filtering * fix: Format NODE_OPTIONS configuration on single line * test: Update profiles and board background persistence tests * test: Replace iPhone 13 Pro with Pixel 5 for mobile test consistency --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
62
apps/ui/tests/profiles/profiles-crud.spec.ts
Normal file
62
apps/ui/tests/profiles/profiles-crud.spec.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* AI Profiles E2E Test
|
||||
*
|
||||
* Happy path: Create a new profile
|
||||
*/
|
||||
|
||||
import { test, expect } from '@playwright/test';
|
||||
import {
|
||||
setupMockProjectWithProfiles,
|
||||
waitForNetworkIdle,
|
||||
navigateToProfiles,
|
||||
clickNewProfileButton,
|
||||
fillProfileForm,
|
||||
saveProfile,
|
||||
waitForSuccessToast,
|
||||
countCustomProfiles,
|
||||
authenticateForTests,
|
||||
handleLoginScreenIfPresent,
|
||||
} from '../utils';
|
||||
|
||||
test.describe('AI Profiles', () => {
|
||||
// Skip: The profiles UI (standalone nav item, profile cards, add/edit dialogs)
|
||||
// has not been implemented yet. The test references data-testid values that
|
||||
// do not exist in the current codebase.
|
||||
test.skip('should create a new profile', async ({ page }) => {
|
||||
await setupMockProjectWithProfiles(page, { customProfilesCount: 0 });
|
||||
await authenticateForTests(page);
|
||||
await page.goto('/');
|
||||
await page.waitForLoadState('load');
|
||||
await handleLoginScreenIfPresent(page);
|
||||
await waitForNetworkIdle(page);
|
||||
await navigateToProfiles(page);
|
||||
|
||||
// Get initial custom profile count (may be 0 or more due to server settings hydration)
|
||||
const initialCount = await countCustomProfiles(page);
|
||||
|
||||
await clickNewProfileButton(page);
|
||||
|
||||
await fillProfileForm(page, {
|
||||
name: 'Test Profile',
|
||||
description: 'A test profile',
|
||||
icon: 'Brain',
|
||||
model: 'sonnet',
|
||||
thinkingLevel: 'medium',
|
||||
});
|
||||
|
||||
await saveProfile(page);
|
||||
|
||||
await waitForSuccessToast(page, 'Profile created');
|
||||
|
||||
// Wait for the new profile to appear in the list (replaces arbitrary timeout)
|
||||
// The count should increase by 1 from the initial count
|
||||
await expect(async () => {
|
||||
const customCount = await countCustomProfiles(page);
|
||||
expect(customCount).toBe(initialCount + 1);
|
||||
}).toPass({ timeout: 5000 });
|
||||
|
||||
// Verify the count is correct (final assertion)
|
||||
const finalCount = await countCustomProfiles(page);
|
||||
expect(finalCount).toBe(initialCount + 1);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user