관리자 편집 보호: 자동 매칭은 관리자가 정한 영상을 덮어쓰지 않음(쓰기 시점 조건·실제 갱신만 집계), 다시 가져와도 관리자가 정한 장르(빈 선택 포함) 유지, 안 바꾼 유튜브 주소는 보내지 않음 + 후보 확정 버튼, 회귀 테스트 3개·e2e
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -162,6 +162,18 @@ try {
|
||||
await p.getByText('저장했어요.').first().waitFor();
|
||||
await p.locator('.data-table').getByText('확정').waitFor();
|
||||
expect(app.db.query<{ youtube_id: string }, []>("SELECT youtube_id FROM songs WHERE melon_id = 1").get()!.youtube_id === 'VO88htcm09E', '유튜브 저장 안 됨');
|
||||
// 회귀(리뷰 2026-10-18): 영상 없는 곡에 메모만 저장해도 자동 검색 대상에서 빠지지 않는다
|
||||
await p.getByLabel('노래 검색').fill('Love wins');
|
||||
await p.getByRole('button', { name: '검색' }).click();
|
||||
await p.getByRole('button', { name: 'Love wins all' }).click();
|
||||
await p.getByLabel('메모').fill('메모만 저장');
|
||||
const patchReq = p.waitForRequest((r) => r.method() === 'PATCH' && r.url().includes('/api/admin/songs/'));
|
||||
await p.getByRole('button', { name: '저장' }).click();
|
||||
const sent = JSON.parse((await patchReq).postData() ?? '{}');
|
||||
expect(!('youtube' in sent), `바꾸지 않은 유튜브 주소를 보냄: ${JSON.stringify(sent)}`);
|
||||
await p.getByText('저장했어요.').first().waitFor();
|
||||
const lw = app.db.query<{ note: string; youtube_source: string | null }, []>('SELECT note, youtube_source FROM songs WHERE melon_id = 2').get()!;
|
||||
expect(lw.note === '메모만 저장' && lw.youtube_source === null, `메모 저장 후 youtube_source=${lw.youtube_source}`);
|
||||
await side.getByRole('link', { name: /대시보드/ }).click();
|
||||
await p.getByRole('heading', { name: '대시보드' }).waitFor();
|
||||
await p.screenshot({ path: join(SHOTS, 'stage1-admin.png') });
|
||||
|
||||
Reference in New Issue
Block a user