mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 23:35:44 +00:00
feat(playlist): scoped header search on Playlists browse (#1308)
This commit is contained in:
@@ -16,6 +16,9 @@ describe('syncLiveSearchRouteScope', () => {
|
||||
|
||||
syncLiveSearchRouteScope('/composers');
|
||||
expect(useLiveSearchScopeStore.getState().scope).toBe('composers');
|
||||
|
||||
syncLiveSearchRouteScope('/playlists');
|
||||
expect(useLiveSearchScopeStore.getState().scope).toBe('playlists');
|
||||
});
|
||||
|
||||
it('clears scope and query when leaving browse routes', () => {
|
||||
@@ -27,6 +30,15 @@ describe('syncLiveSearchRouteScope', () => {
|
||||
expect(useLiveSearchScopeStore.getState().query).toBe('');
|
||||
});
|
||||
|
||||
it('clears scope when entering playlist detail', () => {
|
||||
useLiveSearchScopeStore.setState({ query: 'road', scope: 'playlists' });
|
||||
|
||||
syncLiveSearchRouteScope('/playlists/abc123');
|
||||
|
||||
expect(useLiveSearchScopeStore.getState().scope).toBeNull();
|
||||
expect(useLiveSearchScopeStore.getState().query).toBe('');
|
||||
});
|
||||
|
||||
it('clears query when leaving browse with scope already cleared (ghost mode)', () => {
|
||||
useLiveSearchScopeStore.setState({ query: 'beatles', scope: null });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user