fix(test): update FilePreview test to use correct search placeholder

The test was looking for 'Search...' but the actual placeholder is
'Search in file... (Enter: next, Shift+Enter: prev)'. Updated to use
regex /Search in file/ pattern consistent with other tests in the file.
This commit is contained in:
Pedram Amini
2026-02-02 22:02:36 -06:00
parent d41a7035d1
commit 8feb138f30

View File

@@ -849,18 +849,18 @@ print("world")
fireEvent.keyDown(previewContainer!, { key: 'f', metaKey: true });
// Search should be open
expect(screen.getByPlaceholderText('Search...')).toBeInTheDocument();
expect(screen.getByPlaceholderText(/Search in file/)).toBeInTheDocument();
// Press Escape - should close TOC first (it's checked first in the handler)
fireEvent.keyDown(previewContainer!, { key: 'Escape' });
// TOC should be closed, search should still be open
expect(screen.queryByText('Contents')).not.toBeInTheDocument();
expect(screen.getByPlaceholderText('Search...')).toBeInTheDocument();
expect(screen.getByPlaceholderText(/Search in file/)).toBeInTheDocument();
// Press Escape again - should close search
fireEvent.keyDown(previewContainer!, { key: 'Escape' });
expect(screen.queryByPlaceholderText('Search...')).not.toBeInTheDocument();
expect(screen.queryByPlaceholderText(/Search in file/)).not.toBeInTheDocument();
});
});