diff --git a/internal/requests/requests_test.go b/internal/requests/requests_test.go index a0389a92..5b1b9004 100644 --- a/internal/requests/requests_test.go +++ b/internal/requests/requests_test.go @@ -227,7 +227,7 @@ func TestReconciler_CompletesWhenTheWantIsHeld(t *testing.T) { artist, album := seedAlbum(t, q, "Notify Artist", "artist-4", "Notify Album", "group-notify") _ = seedTrack(t, q, album, artist, "Other Track", "/music/notify/01.flac") wantedTrack := seedTrack(t, q, album, artist, "Wanted Track", "/music/notify/02.flac") - if _, err := pool.Exec(ctx, "UPDATE tracks SET mbid = 'rec-wanted', added_at = added_at - interval '1 hour' WHERE id = $1", wantedTrack.ID); err != nil { + if _, err := pool.Exec(ctx, "UPDATE tracks SET mbid = 'rec-wanted', mbid_source = 'tag', added_at = added_at - interval '1 hour' WHERE id = $1", wantedTrack.ID); err != nil { t.Fatal(err) } if _, err := pool.Exec(ctx, "UPDATE wants SET fulfilled_at = now(), album_id = $1 WHERE release_group_mbid = 'group-notify'", album.ID); err != nil { diff --git a/web/src/routes/admin/missing-files/missing-files.test.ts b/web/src/routes/admin/missing-files/missing-files.test.ts index 7ac39102..e8adf9b7 100644 --- a/web/src/routes/admin/missing-files/missing-files.test.ts +++ b/web/src/routes/admin/missing-files/missing-files.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, test, vi } from 'vitest'; -import { render, screen } from '@testing-library/svelte'; +import { render, screen, within } from '@testing-library/svelte'; import { mockQuery } from '../../../test-utils/query'; import type { AdminMissingResponse } from '#lib/api/types.js'; @@ -137,7 +137,9 @@ describe('admin missing files', () => { renderWith(withState); const line = text('reacquisition-state'); expect(line).toMatch(/on the wanted list since 2d ago/i); - expect(screen.getByRole('link', { name: /wanted list/i }).getAttribute('href')).toBe( + expect( + within(screen.getByTestId('reacquisition-state')).getByRole('link', { name: /wanted list/i }).getAttribute('href') + ).toBe( '/admin/wanted?tab=missing' ); });