mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 20:03:37 +00:00
test: enhance agent-service tests with context loading mock
- Added a mock for the `loadContextFiles` function to return an empty context by default, improving test reliability. - Updated the agent-service test suite to ensure proper initialization of the `AgentService` with mocked dependencies. These changes aim to enhance the test coverage and stability of the agent-service functionality.
This commit is contained in:
@@ -24,6 +24,18 @@ export async function navigateToContext(page: Page): Promise<void> {
|
||||
await page.goto('/context');
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
// Wait for loading to complete (if present)
|
||||
const loadingElement = page.locator('[data-testid="context-view-loading"]');
|
||||
try {
|
||||
const loadingVisible = await loadingElement.isVisible({ timeout: 2000 });
|
||||
if (loadingVisible) {
|
||||
// Wait for loading to disappear (context view will appear)
|
||||
await loadingElement.waitFor({ state: 'hidden', timeout: 10000 });
|
||||
}
|
||||
} catch {
|
||||
// Loading element not found or already hidden, continue
|
||||
}
|
||||
|
||||
// Wait for the context view to be visible
|
||||
await waitForElement(page, 'context-view', { timeout: 10000 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user