diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 39d4554..2241c7d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,6 +40,7 @@ The workspace contains the root app (`src/`, `tests/`) and `@libras/website` (`w | `AudioPlayer` | Audio transport, seeking, keyboard shortcuts, and Media Session | | `Covers` / `TrackEngine` | Resource acquisition, download scheduling, and browser URL lifetimes | | `Playlists` | Server-confirmed playlist operations and conflict detection; no offline outbox | +| `Favourites` | Serialized server-confirmed stars and reconciliation; independent account checkpoint, no outbox | | `Router` | Query routes, native fragment anchors, active navigation metadata, and optional view transitions | Routes use the bare query, for example `/webapp/?/library/artist/123#section`. Encode each dynamic path segment with `encodeURIComponent`; fragments remain native in-page anchors. The service worker serves one cached app shell for root/index navigation requests, including their route queries; assets and API requests are excluded. @@ -47,9 +48,10 @@ Routes use the bare query, for example `/webapp/?/library/artist/123#section`. E ### Persistence and account safety - Read Cache collections directly; change them through explicit methods. Session owns account details; Cache accepts an opaque account key and hashes it for storage. An undefined key creates an empty, non-persisting fallback. A defined key does not mean hydration succeeded. +- Favourites use an independent `favourites.json` checkpoint. Server confirmation publishes before device checkpointing; cache failures never repeat a server write. Unreadable favourites documents are preserved, even after a server refresh restores visible memory, and are excluded from drainable retirement writes. Downloaded-only filtering does not disconnect authenticated favourites access. An unknown write outcome blocks further edits until an authoritative refresh succeeds. - Library, queue, playlist, and image memory updates checkpoint asynchronously. Downloads instead await explicit queued/failed/completed commits in one versioned store; failed jobs require explicit Retry or a bulk Download action. Interrupted queued jobs restart from scratch, never adopting unregistered bytes. Successful byte close wins cancellation while completed metadata commits; cancellation joins that work. Unknown queued/failed job fields, including old attempts, are ignored on load and omitted on subsequent writes; orphan-file reclamation after old attempts or abrupt termination is intentionally out of scope. Offline library limits browsing/listening, not requested downloads. Do not treat visible state as proof of persistence. Unreadable download documents are preserved, not reset; readable saved files remain usable. - Credentials use localStorage only, until disconnect. Token login stores username/token/salt; verified direct-password fallback stores the actual password. localStorage is not encrypted and is readable by same-origin scripts. Never log credentials or credential-bearing URLs. Legacy token records migrate without changing account keys; migration writeback is best-effort. -- Disconnect retains local data for offline use. Same-account reconnects reuse the live cache to preserve edits. Account changes drain old writes and retire resources before committing the new workspace. Late results must not leak into a different account. +- Disconnect retains local data for offline use unless optional account-local cleanup is explicitly selected; that cleanup also removes the favourites checkpoint. Same-account reconnects reuse the live cache to preserve edits. Account changes drain old writes and retire resources before committing the new workspace. Late results must not leak into a different account. - Startup and manual refresh pull server state. Reconnecting must not upload an offline queue automatically, and refresh must not replace a playing or paused queue. - Preserve queue IDs and occurrence indexes, including duplicates and unavailable tracks. Filtering the UI must not rewrite the saved queue. - Release browser resources explicitly. The service worker caches the app shell, not API responses or music; offline audio downloads are explicit user actions. @@ -94,17 +96,17 @@ NODE_PATH=/path/to/external/node_modules PREVIEW_URL=http://127.0.0.1:5173 \ Select suites for the behavior being changed: -| Suite in `tests/browser/` | Coverage | -| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `edgerunner.test.cjs` | Shared styles, fonts, native controls, overlays, and reduced motion | -| `navigation.test.cjs` | Document scrolling, shell, playback, query routes, anchors, and optional offline navigation | -| `startup.test.cjs` | Initial Settings route, reloads, and subsequent animated navigation | -| `pwa-updates.test.cjs` | Self-hosted production builds: real worker installation, per-tab consent, repeated discovery, offline application, failed precache, and optional old-plugin migration | -| `library.test.cjs`, `search.test.cjs` | Browsing, actions, responsive layouts, and native dismissal | -| `downloads.test.cjs`, `settings.test.cjs` | Actual app/OPFS behavior with intercepted Subsonic requests | -| `atmosphere.test.cjs` | Document/dialog scroll timelines; self-contained, no server required | -| `website-cascade.test.cjs` | Script-free landing layout, keyboard/FAQ behavior, and standalone demo journeys | -| `design-improvements.test.cjs` | Compact details, full-height player, queue anchors, confirmation, gradients, popover timing, titles, and demo guidance (website server) | +| Suite in `tests/browser/` | Coverage | +| ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `edgerunner.test.cjs` | Shared styles, fonts, native controls, overlays, and reduced motion | +| `navigation.test.cjs` | Document scrolling, shell, playback, query routes, anchors, and optional offline navigation | +| `startup.test.cjs` | Initial Settings route, reloads, and subsequent animated navigation | +| `pwa-updates.test.cjs` | Self-hosted production builds: real worker installation, per-tab consent, repeated discovery, offline application, failed precache, and optional old-plugin migration | +| `library.test.cjs`, `search.test.cjs`, `favourites.test.cjs` | Browsing, actions, responsive layouts, native dismissal, server stars, and URL-controlled Search criteria | +| `downloads.test.cjs`, `settings.test.cjs` | Actual app/OPFS behavior with intercepted Subsonic requests | +| `atmosphere.test.cjs` | Document/dialog scroll timelines; self-contained, no server required | +| `website-cascade.test.cjs` | Script-free landing layout, keyboard/FAQ behavior, and standalone demo journeys | +| `design-improvements.test.cjs` | Compact details, full-height player, queue anchors, confirmation, gradients, popover timing, titles, and demo guidance (website server) | `cache-downloads.test.cjs` exercises native OPFS close/publication boundaries and restart-from-scratch behavior by importing the owning modules. Run it against the app **dev** server; Downloads, Settings, and navigation checks can run against production preview. diff --git a/src/_album.svelte b/src/_album.svelte index c0cfdb3..5820810 100644 --- a/src/_album.svelte +++ b/src/_album.svelte @@ -1,5 +1,7 @@ {album?.title ?? "Album"} | {appName} @@ -276,8 +292,14 @@
- -

{menuTrack?.title ?? album?.title}

+ +

+ {menuTrackId !== undefined ? menuTrack?.title : album?.title} +

+
{/snippet} diff --git a/src/_artist.svelte b/src/_artist.svelte index 28c6347..ffba417 100644 --- a/src/_artist.svelte +++ b/src/_artist.svelte @@ -1,5 +1,7 @@ {artist?.name ?? "Artist"} | {appName} @@ -97,7 +115,9 @@ />
-

{artist.name}

+
+

{artist.name}

+
+
{/snippet} diff --git a/src/_library.svelte b/src/_library.svelte index 297f8ad..01b9331 100644 --- a/src/_library.svelte +++ b/src/_library.svelte @@ -1,5 +1,7 @@ Your library | {appName} @@ -278,6 +297,11 @@ Download +
{/snippet} diff --git a/src/_search.svelte b/src/_search.svelte index 5f16f45..5b14fb1 100644 --- a/src/_search.svelte +++ b/src/_search.svelte @@ -1,6 +1,6 @@ + +{#if target || icon} + + {#if target && (reason || error || (icon && pending))} +
+

+ {error || reason || progress} +

+ {#if reason || error} + { + if (onsettings) onsettings(); + else { + event.currentTarget.closest("[popover]")?.hidePopover(); + event.currentTarget.closest("dialog")?.close(); + } + }}>Open settings + {/if} +
+ {/if} +{/if} + + diff --git a/src/ui/player.svelte b/src/ui/player.svelte index a8aa7cd..1305b10 100644 --- a/src/ui/player.svelte +++ b/src/ui/player.svelte @@ -1,5 +1,7 @@ -{#if visible}{/if} +{#if visible} false, + key: () => "", + pending: new Map(), + targetError: () => "", + } as unknown as import("../src/favourites.svelte").Favourites)} + />{/if} diff --git a/tests/search.test.ts b/tests/search.test.ts index af9401b..8f52540 100644 --- a/tests/search.test.ts +++ b/tests/search.test.ts @@ -15,7 +15,7 @@ describe("shareable search URLs", () => { const url = new URL(searchHref(query, types), "https://example.test/demo/"); expect(url.search.startsWith("?/search")).toBe(true); expect(url.searchParams.get("/search")).toBe(""); - expect(parseSearch(url.searchParams)).toEqual({ query, types }); + expect(parseSearch(url.searchParams)).toEqual({ query, types, favourite: false }); expect(url.pathname).toBe("/demo/"); expect(url.hash).toBe(""); } @@ -27,7 +27,7 @@ describe("shareable search URLs", () => { ); const entries = [...parameters]; const criteria = parseSearch(parameters); - expect(criteria).toEqual({ query: "first", types: ["artist", "track"] }); + expect(criteria).toEqual({ query: "first", types: ["artist", "track"], favourite: false }); expect([...parameters]).toEqual(entries); expect(searchHref(criteria.query, criteria.types)).toBe( "?/search&type=artist&type=track&q=first", @@ -36,17 +36,19 @@ describe("shareable search URLs", () => { expect(parseSearch(new URLSearchParams("/search&type=unknown"))).toEqual({ query: "", types: [], + favourite: false, }); expect(parseSearch(new URLSearchParams("/search&q=&q=second"))).toEqual({ query: "", types: [], + favourite: false, }); expect(searchHref()).toBe("?/search"); }); it("does not read search criteria from an anchor", () => { const url = new URL("https://example.test/?/search#q=ignored&type=track"); - expect(parseSearch(url.searchParams)).toEqual({ query: "", types: [] }); + expect(parseSearch(url.searchParams)).toEqual({ query: "", types: [], favourite: false }); }); }); diff --git a/tests/session-favourites.test.ts b/tests/session-favourites.test.ts new file mode 100644 index 0000000..fb64933 --- /dev/null +++ b/tests/session-favourites.test.ts @@ -0,0 +1,317 @@ +// @vitest-environment happy-dom +import { afterEach, expect, it, vi } from "vitest"; +import { createSession, createStorage, credentials, deferred } from "./session-test-helpers"; +import { getAccountKey } from "../src/auth"; +import { installDisk } from "./cache-test-helpers"; +import { Cache } from "../src/cache.svelte"; +import type { FavouriteState } from "../src/schema"; +afterEach(() => { + vi.restoreAllMocks(); + vi.unstubAllGlobals(); +}); +it("refreshes at downloaded-only startup, permits authenticated edits, and retires access on disconnect", async () => { + const storage = createStorage(); + storage.setItem("navidrome-offline-mode", "true"); + let selected = false; + const methods: string[] = []; + vi.stubGlobal( + "fetch", + vi.fn(async (url: string) => { + const method = new URL(url).pathname.split("/").pop()!; + methods.push(method); + if (method === "star.view") selected = true; + return new Response( + JSON.stringify({ + "subsonic-response": { + status: "ok", + starred2: { artist: selected ? [{ id: "artist", name: "Favourite" }] : [] }, + }, + }), + ); + }), + ); + let state: FavouriteState = { fetchedAt: null, artists: [], albums: [], tracks: [] }; + vi.spyOn(Cache.prototype, "favourites", "get").mockImplementation(() => state); + vi.spyOn(Cache.prototype, "setFavourites").mockImplementation((value) => { + state = value as FavouriteState; + }); + const s = createSession(true, storage, true); + try { + s.session.start(); + await vi.waitFor(() => expect(state.fetchedAt).not.toBeNull()); + expect(s.session.offlineMode).toBe(true); + expect(s.metadata.getModifiedAt).not.toHaveBeenCalled(); + expect(s.playback.refreshQueue).not.toHaveBeenCalled(); + vi.spyOn(s.selection.cache!, "artists", "get").mockReturnValue( + new Map([["artist", { id: "artist", name: "Artist", localOnly: false }]]), + ); + await s.favourites!.toggle({ kind: "artists", id: "artist" }); + expect(s.favourites!.has({ kind: "artists", id: "artist" })).toBe(true); + expect(s.session.offlineMode).toBe(true); + await s.session.refresh(); + expect(methods.filter((method) => method === "getStarred2.view").length).toBe(3); + s.session.disconnect(); + expect(s.favourites!.available).toBe(false); + expect(state.artists).toHaveLength(1); + await expect(s.favourites!.toggle({ kind: "artists", id: "artist" })).rejects.toThrow( + "Reconnect", + ); + } finally { + await s.destroy(); + } +}); + +it.each([false, true])( + "retains manual refresh ownership across downloaded-only toggle from %s", + async (offline) => { + const storage = createStorage(); + storage.setItem("navidrome-offline-mode", String(offline)); + let gate: ReturnType> | undefined; + let reads = 0; + vi.stubGlobal( + "fetch", + vi.fn(async (url: string) => { + if (url.includes("getStarred2")) { + reads++; + await gate?.promise; + } + return new Response( + JSON.stringify({ + "subsonic-response": { + status: "ok", + starred2: {}, + indexes: { lastModified: 100 }, + searchResult3: {}, + }, + }), + ); + }), + ); + const s = createSession(true, storage, true); + try { + s.session.start(); + await vi.waitFor(() => + expect(s.selection.cache?.favourites.fetchedAt).toEqual(expect.any(Number)), + ); + await vi.waitFor(() => expect(s.session.syncing).toBe(false)); + const before = reads; + gate = deferred(); + const refresh = s.session.refresh(); + await vi.waitFor(() => expect(s.favourites!.loading).toBe(true)); + await s.session.setOfflineMode(!offline); + expect(s.session.offlineMode).toBe(!offline); + expect(s.session.syncing).toBe(true); + expect(s.session.refreshing).toBe(true); + const duplicate = s.session.refresh(); + expect(reads).toBe(before + 1); + gate.resolve(); + await Promise.all([refresh, duplicate]); + expect(s.session.syncing).toBe(false); + expect(s.session.refreshing).toBe(false); + gate = undefined; + await s.session.refresh(); + expect(reads).toBe(before + 2); + expect(s.session.syncing).toBe(false); + } finally { + gate?.resolve(); + await s.destroy(); + } + }, +); + +it.each(["normal", "credentials", "preferences"])( + "preserves a submitted uncertain write through %s disconnect and failed same-account reconnect with real Cache", + async (failure) => { + installDisk(); + const library = { + savedAt: 100, + lastModified: 100, + artists: [{ id: "artist", name: "Artist", localOnly: false }], + albums: [{ id: "album", title: "Album", artistIds: ["artist"], genres: [] }], + tracks: [{ id: "song", title: "Song", albumId: "album", artistIds: ["artist"], genres: [] }], + }; + const seed = new Cache(getAccountKey(credentials)); + await seed.load(); + await seed.replaceLibrary(library); + seed.setFavourites({ fetchedAt: 1, artists: [], albums: [], tracks: [] }); + await seed.flush(); + const submitted = deferred(); + const response = deferred(); + let remoteStarred = false; + let failReads = false; + let writes = 0; + vi.stubGlobal( + "fetch", + vi.fn(async (url: string) => { + if (url.includes("star.view")) { + writes++; + remoteStarred = true; + submitted.resolve(); + // Model a server-accepted write whose response outlives client cancellation. + await response.promise; + } + if (url.includes("getStarred2") && failReads) throw new Error("Mock transport unavailable"); + return new Response( + JSON.stringify({ + "subsonic-response": { + status: "ok", + indexes: { lastModified: 100 }, + starred2: { song: remoteStarred ? [{ id: "song", title: "Song" }] : [] }, + }, + }), + ); + }), + ); + const storage = createStorage(); + storage.setItem("navidrome-offline-mode", "true"); + const s = createSession(true, storage, true); + s.loadCache.mockRestore(); + s.saveLibrary.mockRestore(); + s.metadata.readLibrary.mockResolvedValue(library); + try { + s.session.start(); + await vi.waitFor(() => expect(s.session.localReady).toBe(true)); + await vi.waitFor(() => expect(s.session.syncing).toBe(false)); + const cache = s.selection.cache!; + expect(cache.tracks.has("song")).toBe(true); + const edit = s.favourites!.toggle({ kind: "tracks", id: "song" }); + const retiredEdit = edit.catch((error) => error); + await submitted.promise; + const failingStorage = + failure === "credentials" + ? vi.spyOn(s.auth, "clear").mockImplementation(() => { + throw new Error("Storage denied"); + }) + : failure === "preferences" + ? vi.spyOn(storage, "setItem").mockImplementation(() => { + throw new Error("Storage denied"); + }) + : undefined; + expect(s.session.disconnect()).toBe(failure === "normal"); + expect(s.favourites!.available).toBe(false); + failingStorage?.mockRestore(); + expect(s.favourites!.outcomeUnknown).toBe(true); + failReads = true; + expect( + await s.session.connect({ + host: credentials.host, + username: credentials.username, + password: "fixture", + }), + ).toBe(true); + await vi.waitFor(() => expect(s.session.syncing).toBe(false)); + expect(s.selection.cache).toBe(cache); + expect(s.favourites!.error).toBeDefined(); + expect(s.favourites!.has({ kind: "tracks", id: "song" })).toBe(false); + await expect(s.favourites!.toggle({ kind: "tracks", id: "song" })).rejects.toThrow( + "Outcome unknown", + ); + response.resolve(); + expect(await retiredEdit).toMatchObject({ name: "AbortError" }); + expect(s.favourites!.outcomeUnknown).toBe(true); + expect(writes).toBe(1); + failReads = false; + await s.session.refresh(); + expect(s.favourites!.has({ kind: "tracks", id: "song" })).toBe(true); + expect(s.favourites!.outcomeUnknown).toBe(false); + expect(writes).toBe(1); + await cache.flush(); + const restored = new Cache(getAccountKey(credentials)); + await restored.load(); + expect(restored.favourites.tracks[0]?.id).toBe("song"); + } finally { + response.resolve(); + await s.destroy(); + } + }, +); + +it("retires an account with preserved corrupt favourites after a confirmed server refresh", async () => { + const disk = installDisk(); + const seed = new Cache(getAccountKey(credentials)); + await seed.load(); + seed.setFavourites({ fetchedAt: 1, artists: [], albums: [], tracks: [] }); + await seed.flush(); + const path = [...disk.files.keys()].find((path) => path.endsWith("/favourites.json"))!; + disk.files.set(path, "corrupt original bytes"); + vi.stubGlobal( + "fetch", + vi.fn( + async () => + new Response( + JSON.stringify({ + "subsonic-response": { + status: "ok", + starred2: { song: [{ id: "confirmed", title: "Confirmed" }] }, + }, + }), + ), + ), + ); + const s = createSession(true, createStorage(), true); + s.loadCache.mockRestore(); // Exercise actual OPFS restoration and account retirement. + try { + s.session.start(); + await vi.waitFor(() => expect(s.selection.cache?.favourites.tracks[0]?.id).toBe("confirmed")); + const previous = s.selection.cache!; + expect(previous.dirty).toBe(true); + expect(previous.favouritesError).toBeDefined(); + await expect(previous.flush()).rejects.toThrow(); + s.session.disconnect(); + expect( + await s.session.connect({ + host: credentials.host, + username: "other-account", + password: "fixture", + }), + ).toBe(true); + expect(s.selection.cache).not.toBe(previous); + expect(s.selection.cache?.key).toBe( + getAccountKey({ host: credentials.host, username: "other-account" }), + ); + expect(disk.files.get(path)).toBe("corrupt original bytes"); + expect(previous.dirty).toBe(true); + expect(previous.pendingWrites).toBe(false); + expect(previous.favouritesError).toBeDefined(); + } finally { + await s.destroy(); + } +}); + +it("does not gate library/queue but retains refresh busy feedback until favourites settle", async () => { + const gate = deferred(); + vi.stubGlobal( + "fetch", + vi.fn(async () => { + await gate.promise; + return new Response( + JSON.stringify({ + "subsonic-response": { + status: "ok", + starred2: { song: [{ id: "late", title: "Late" }] }, + }, + }), + ); + }), + ); + const s = createSession(true, createStorage(), true); + try { + s.session.start(); + await vi.waitFor(() => expect(s.playback.refreshQueue).toHaveBeenCalledOnce()); + expect(s.favourites!.loading).toBe(true); + expect(s.session.syncing).toBe(true); + const duplicate = s.session.refresh(); + expect(s.metadata.readLibrary).not.toHaveBeenCalled(); + expect(s.playback.refreshQueue).toHaveBeenCalledOnce(); + expect(s.session.syncing).toBe(true); + expect(s.favourites!.loading).toBe(true); + s.session.disconnect(); + gate.resolve(); + await duplicate; + await new Promise((resolve) => setTimeout(resolve, 0)); + expect(s.selection.cache?.favourites.tracks).toEqual([]); + } finally { + gate.resolve(); + await s.destroy(); + } +}); diff --git a/tests/session-test-helpers.ts b/tests/session-test-helpers.ts index 6c75647..e7da4fb 100644 --- a/tests/session-test-helpers.ts +++ b/tests/session-test-helpers.ts @@ -8,6 +8,7 @@ import { Playback } from "../src/playback.svelte"; import { Cache, type LibrarySnapshot } from "../src/cache.svelte"; import type { Account } from "../src/schema"; import { Session } from "../src/session.svelte"; +import { Favourites } from "../src/favourites.svelte"; export const credentials = { host: "https://music.example", @@ -53,7 +54,7 @@ export function createStorage() { }; } -export function createSession(saved = false, storage = createStorage()) { +export function createSession(saved = false, storage = createStorage(), withFavourites = false) { const selection = new TestSelection(); const auth = new AuthStore(storage); if (saved) auth.save(credentials); @@ -140,6 +141,7 @@ export function createSession(saved = false, storage = createStorage()) { }, }; }); + const favourites = withFavourites ? new Favourites(selection) : undefined; const session = new Session({ selection, network, @@ -148,16 +150,19 @@ export function createSession(saved = false, storage = createStorage()) { tracks: trackEngine, playback: player, preferences: storage, + favourites, }); return { async destroy() { session.destroy(); + favourites?.destroy(); await player.destroy(); covers.activate.mockRestore(); coverResources.destroy(); trackEngine.destroy(); }, session, + favourites, network, selection, auth, diff --git a/tests/subsonic-client.test.ts b/tests/subsonic-client.test.ts index 00dc61d..457e4d2 100644 --- a/tests/subsonic-client.test.ts +++ b/tests/subsonic-client.test.ts @@ -212,12 +212,17 @@ describe("subsonic client", () => { await expect(client.search3(page)).rejects.toThrow("invalid Subsonic response"); }); - it("preserves structured artist credits and strips legacy artist fields", async () => { + it("preserves structured and standard singular credits while stripping legacy artistId", async () => { const artists = [ { id: "lead", name: "Lead" }, { id: "guest", name: "Guest" }, ]; - const credits = { artists, displayArtist: "Lead feat. Guest", artist: 123, artistId: 123 }; + const credits = { + artists, + displayArtist: "Lead feat. Guest", + artist: "Standard credit", + artistId: 123, + }; vi.stubGlobal( "fetch", vi.fn(async () => @@ -232,8 +237,24 @@ describe("subsonic client", () => { const client = new SubsonicClient(auth); await expect(client.search3(page)).resolves.toEqual({ artists: [], - albums: [{ id: "album", name: "Album", artists, displayArtist: "Lead feat. Guest" }], - tracks: [{ id: "song", title: "Song", artists, displayArtist: "Lead feat. Guest" }], + albums: [ + { + id: "album", + name: "Album", + artists, + displayArtist: "Lead feat. Guest", + artist: "Standard credit", + }, + ], + tracks: [ + { + id: "song", + title: "Song", + artists, + displayArtist: "Lead feat. Guest", + artist: "Standard credit", + }, + ], }); }); diff --git a/website/deezer-client.ts b/website/deezer-client.ts index 3f2aa3e..18d3556 100644 --- a/website/deezer-client.ts +++ b/website/deezer-client.ts @@ -160,6 +160,16 @@ export class DeezerSubsonicClient implements SubsonicApi { ); return mediaUrl(track.preview, "https://cdnt-preview.dzcdn.net"); } + async getStarred2(): ReturnType { + throw new Error("Favourites are not supported in the demo."); + } + async star(): Promise { + throw new Error("Favourites are not supported in the demo."); + } + async unstar(): Promise { + throw new Error("Favourites are not supported in the demo."); + } + async getPlaylists() { this.signal.throwIfAborted(); return []; diff --git a/website/demo.test.ts b/website/demo.test.ts index 83207a6..9e137de 100644 --- a/website/demo.test.ts +++ b/website/demo.test.ts @@ -262,7 +262,7 @@ it("syncs and refreshes the snapshot even when live Deezer album responses would await vi.waitFor(() => expect(document.querySelector("#settings-refresh")?.getAttribute("aria-busy")).toBe("false"), ); - expect(document.body.textContent).not.toContain("Synchronization needs attention"); + expect(document.body.textContent).toContain("Favourites are not supported in the demo."); expect(document.body.textContent).not.toContain("Unexpected Deezer album or artist"); expect(read).not.toHaveBeenCalled(); });