feat(ui): refine fleet search/filter toolbar with status chips
Adopt Portainer/Beszel-style fleet controls: prominent search, status facet chips with counts, active filter chips, result count, and primary-row sort/select. Keep advanced filters collapsed for secondary facets. Tests and production dist rebuild for gateway 8788.
This commit is contained in:
@@ -53,6 +53,30 @@ describe('FleetPage card navigation', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('FleetPage search and filter toolbar', () => {
|
||||
it('filters by status chips and clears active search conditions', () => {
|
||||
render(<FleetPage initialData={snapshot} />);
|
||||
|
||||
const search = screen.getByRole('search', { name: '实例搜索与筛选' });
|
||||
expect(within(search).getByPlaceholderText('搜索名称、ID、标签、源地址…')).toBeTruthy();
|
||||
expect(within(search).getByText(/显示/).textContent).toMatch(/显示\s*1\s*\/\s*1/);
|
||||
|
||||
fireEvent.click(within(search).getByRole('button', { name: /离线/ }));
|
||||
expect(screen.queryByRole('article', { name: 'Alpha modem 实例概览' })).toBeNull();
|
||||
expect(within(search).getByText(/显示/).textContent).toMatch(/显示\s*0\s*\/\s*1/);
|
||||
expect(within(search).getByRole('button', { name: /移除筛选 状态:离线/ })).toBeTruthy();
|
||||
|
||||
fireEvent.change(within(search).getByPlaceholderText('搜索名称、ID、标签、源地址…'), {
|
||||
target: { value: 'Alpha' },
|
||||
});
|
||||
expect(within(search).getByRole('button', { name: /移除筛选 搜索:Alpha/ })).toBeTruthy();
|
||||
|
||||
fireEvent.click(within(search).getByRole('button', { name: '清除全部筛选' }));
|
||||
expect(screen.getByRole('article', { name: 'Alpha modem 实例概览' })).toBeTruthy();
|
||||
expect(within(search).getByText(/显示/).textContent).toMatch(/显示\s*1\s*\/\s*1/);
|
||||
});
|
||||
});
|
||||
|
||||
describe('FleetPage batch and restart actions', () => {
|
||||
it('exposes card restart controls and batch restart entry for selected instances', async () => {
|
||||
const prepare = vi.fn(async () => ({
|
||||
|
||||
Reference in New Issue
Block a user