fix: Update wizard test mocks and assertions to match source changes

- Added listDocs and readDoc to autorun mock (phaseGenerator disk fallback)
- Updated wizard title assertions from 'Select Your Agent' to 'Create a Maestro Agent'
- Updated conversation screen text assertion to 'Project Understanding Confidence'

Claude ID: 207f9996-7530-493f-bb99-96a3bb26c6f7
Maestro ID: b9bc0d08-5be2-4fdf-93cd-5618a8d53b35
This commit is contained in:
Pedram Amini
2025-12-11 01:52:50 -06:00
parent 0d9ed25145
commit 9efd3466c1
2 changed files with 14 additions and 10 deletions

View File

@@ -249,6 +249,8 @@ const mockMaestro = {
saveImage: vi.fn(),
writeDoc: vi.fn(),
deleteImage: vi.fn(),
listDocs: vi.fn().mockResolvedValue({ success: true, files: [] }),
readDoc: vi.fn().mockResolvedValue({ success: true, content: '' }),
},
fs: {
readFile: vi.fn(),
@@ -307,7 +309,7 @@ describe('Wizard Integration Tests', () => {
renderWithProviders(<TestWrapper />);
await waitFor(() => {
expect(screen.getByText('Select Your Agent')).toBeInTheDocument();
expect(screen.getByText('Create a Maestro Agent')).toBeInTheDocument();
expect(screen.getByText('Step 1 of 4')).toBeInTheDocument();
});
});
@@ -342,7 +344,7 @@ describe('Wizard Integration Tests', () => {
renderWithProviders(<TestWrapper />);
await waitFor(() => {
expect(screen.getByText('Select Your Agent')).toBeInTheDocument();
expect(screen.getByText('Create a Maestro Agent')).toBeInTheDocument();
});
// Trigger manual continue
@@ -477,7 +479,7 @@ describe('Wizard Integration Tests', () => {
fireEvent.click(screen.getByTestId('open-wizard'));
await waitFor(() => {
expect(screen.getByText('Select Your Agent')).toBeInTheDocument();
expect(screen.getByText('Create a Maestro Agent')).toBeInTheDocument();
});
// Click close button in wizard modal
@@ -662,7 +664,7 @@ describe('Wizard Integration Tests', () => {
renderWithProviders(<TestWrapper />);
await waitFor(() => {
expect(screen.getByText('Select Your Agent')).toBeInTheDocument();
expect(screen.getByText('Create a Maestro Agent')).toBeInTheDocument();
});
// Navigate to step 2
@@ -932,7 +934,7 @@ describe('Wizard Integration Tests', () => {
renderWithProviders(<TestWrapper />);
await waitFor(() => {
expect(screen.getByText('Select Your Agent')).toBeInTheDocument();
expect(screen.getByText('Create a Maestro Agent')).toBeInTheDocument();
});
// Analytics callback should be called for fresh start
@@ -1123,7 +1125,7 @@ describe('Wizard Integration Tests', () => {
renderWithProviders(<TestWrapper />);
await waitFor(() => {
expect(screen.getByText('Select Your Agent')).toBeInTheDocument();
expect(screen.getByText('Create a Maestro Agent')).toBeInTheDocument();
});
// Content should have wizard-content class
@@ -1404,7 +1406,7 @@ describe('Wizard Integration Tests', () => {
// Wizard should still open
await waitFor(() => {
expect(screen.getByText('Select Your Agent')).toBeInTheDocument();
expect(screen.getByText('Create a Maestro Agent')).toBeInTheDocument();
});
});
});

View File

@@ -104,6 +104,8 @@ const mockMaestro = {
saveImage: vi.fn(),
writeDoc: vi.fn(),
deleteImage: vi.fn(),
listDocs: vi.fn().mockResolvedValue({ success: true, files: [] }),
readDoc: vi.fn().mockResolvedValue({ success: true, content: '' }),
},
fs: {
readFile: vi.fn(),
@@ -474,7 +476,7 @@ describe('Wizard Keyboard Navigation', () => {
renderWithProviders(<ConversationWithEscape theme={mockTheme} />);
const container = screen.getByText('Project Understanding').closest('div[tabindex]');
const container = screen.getByText('Project Understanding Confidence').closest('div[tabindex]');
// Press Escape to go back
fireEvent.keyDown(container!, { key: 'Escape' });
@@ -594,7 +596,7 @@ describe('Wizard Keyboard Navigation', () => {
renderWithProviders(<TestWrapper />);
await waitFor(() => {
expect(screen.getByText('Select Your Agent')).toBeInTheDocument();
expect(screen.getByText('Create a Maestro Agent')).toBeInTheDocument();
});
// Click close button on step 1
@@ -630,7 +632,7 @@ describe('Wizard Keyboard Navigation', () => {
renderWithProviders(<TestWrapper />);
await waitFor(() => {
expect(screen.getByText('Select Your Agent')).toBeInTheDocument();
expect(screen.getByText('Create a Maestro Agent')).toBeInTheDocument();
});
// Click the backdrop (the div with wizard-backdrop class)