mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-01 04:16:24 -05:00
Any Tag alone searches the library, and Zim search does not offer it (#960)
On the search page, choosing Any Tag without a search string left the Dashboard showing: the page, the Files results and the Files count all waited for a search string or tag names. Zim search has no "any tag" search, and its tag picker's Any button left no filter applied, so the picker no longer offers it. Zim and Other counts are only requested when there is a search string or tag names to count by. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f1d344d8a2
commit
30b2bf6df0
7 changed files with 92 additions and 10 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import React from 'react';
|
||||
import {render, screen} from '../test-utils';
|
||||
import {ZimCatalogItemRow} from './Zim';
|
||||
import {ZimCatalogItemRow, ZimSearchView} from './Zim';
|
||||
import {TagsContext} from '../Tags';
|
||||
import {tagsContextFixture} from '../test-fixtures';
|
||||
import {Table} from './ui';
|
||||
|
||||
/*
|
||||
|
|
@ -113,3 +115,18 @@ describe('the outdated Zims banner', () => {
|
|||
expect(screen.getByText('zims/wikipedia_en_all_maxi_2024-01.zim')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
/*
|
||||
* The Zim search tab's tag picker. Zim search can filter by specific tags but has no "any tag" search, and
|
||||
* picking "Any" there left no filter applied -- so the picker must not offer it.
|
||||
*/
|
||||
describe('the Zim search tag picker', () => {
|
||||
it('does not offer Any', async () => {
|
||||
render(<ZimSearchView suggestions={{zimsEstimates: []}} loading={false}/>, {
|
||||
contexts: [[TagsContext, tagsContextFixture({tags: [{name: 'one'}]})]],
|
||||
});
|
||||
fireEvent.click(screen.getByLabelText('Add tag'));
|
||||
expect(await screen.findByText('Applied Tags')).toBeInTheDocument();
|
||||
expect(screen.queryByRole('button', {name: 'Any'})).toBeNull();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue