mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-31 12:48:10 +00:00
feat: match the Security masthead to the primary-page hero and make History search realtime (#1365)
- Masthead: add `size` and `subtitle` to PageMasthead and render the Security masthead at the hero title size with a one-line posture summary, so its height and weight match the Home and Fleet mastheads. The compact size with no subtitle stays the default, so Settings, Console, and Logs are unchanged. - History search now applies as you type (a short debounce, no Enter press), matching the Fleet overview search. It stays server-side so the query searches every completed scan, not just the loaded page.
This commit is contained in:
@@ -125,11 +125,11 @@ describe('HistoryTab', () => {
|
||||
expect(screen.getByRole('button', { name: /Compare \(2\/2\)/ })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('searches by image on Enter, adding imageRefLike to the request', async () => {
|
||||
it('searches by image as you type (no Enter), adding imageRefLike to the request', async () => {
|
||||
mockedFetch.mockResolvedValue(listResponse([scan({ image_ref: 'alpine:3.19' })]));
|
||||
render(<HistoryTab onInspect={vi.fn()} />);
|
||||
await waitFor(() => expect(screen.getByText('alpine:3.19')).toBeInTheDocument());
|
||||
await userEvent.type(screen.getByPlaceholderText('Search by image...'), 'redis{Enter}');
|
||||
await userEvent.type(screen.getByPlaceholderText('Search by image...'), 'redis');
|
||||
await waitFor(() => {
|
||||
const calls = mockedFetch.mock.calls.map((c) => c[0] as string);
|
||||
expect(calls.some((u) => u.includes('imageRefLike=redis'))).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user