mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-21 23:05:46 +00:00
fix(themes): offline banner for the Theme Store (#1013)
* fix(themes): show an offline banner when the Theme Store is unavailable When the registry can't be fetched and no catalogue is cached, the store now shows a clear offline banner (icon, message, retry) in place of the list, and hides the search/filter toolbar — there is nothing to browse. The cached-catalogue fallback with its offline indicator is unchanged, so the store still works offline when a catalogue was previously cached. * docs(themes): note the offline-banner PR in the Theme Store entry Add PR #1013 to the still-unreleased Theme Store changelog and credits entry, alongside the other follow-ups.
This commit is contained in:
@@ -143,4 +143,14 @@ describe('ThemeStoreSection — pagination & refresh', () => {
|
||||
await waitFor(() => expect(container.querySelector('.animate-spin')).toBeNull());
|
||||
expect(rows(container)).toHaveLength(12);
|
||||
});
|
||||
|
||||
it('shows an offline banner and hides the toolbar when the registry is unavailable', async () => {
|
||||
fetchRegistryMock.mockRejectedValue(new Error('offline'));
|
||||
renderWithProviders(<ThemeStoreSection />);
|
||||
|
||||
expect(await screen.findByText('The Theme Store is offline')).toBeInTheDocument();
|
||||
// No catalogue to browse → the search/filter toolbar is not rendered.
|
||||
expect(screen.queryByRole('searchbox')).not.toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: 'Retry' })).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user