feat(web): use static SVG asset for album fallback cover
Replaces the hand-rolled inline-data-URL placeholder with a static SVG asset at /placeholders/album-fallback.svg. SvelteKit's adapter-static publishes everything in web/static/ at the URL root and the Go binary embeds the build output, so this resolves identically in dev and prod. Operator can swap the artwork by replacing the file — no code changes. Test updated to use toContain rather than strict equality, since jsdom resolves relative URLs against the test origin. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -62,11 +62,13 @@ describe('AlbumCard', () => {
|
||||
expect(screen.queryByText(/1959/)).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('broken cover falls back to FALLBACK_COVER data URL', async () => {
|
||||
test('broken cover falls back to FALLBACK_COVER asset', async () => {
|
||||
const { container } = render(AlbumCard, { props: { album } });
|
||||
const img = container.querySelector('img') as HTMLImageElement;
|
||||
await fireEvent.error(img);
|
||||
expect(img.src).toBe(FALLBACK_COVER);
|
||||
// jsdom resolves relative URLs against the test origin; assert containment
|
||||
// rather than strict equality to keep the test agnostic of the host.
|
||||
expect(img.src).toContain(FALLBACK_COVER);
|
||||
});
|
||||
|
||||
test('+ queue button fetches album detail and calls enqueueTracks', async () => {
|
||||
|
||||
Reference in New Issue
Block a user