Songs offered links to all five services. Settings now has "Your music services": pick the ones you use and songs only show those, with the main one as the big button. Until someone picks, they still see all of them. Onboarding sets it to the app you said you listen with. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -115,3 +115,16 @@ describe('onboarding flag', () => {
|
||||
expect(again.onboardedAt).toBe(first.onboardedAt);
|
||||
});
|
||||
});
|
||||
|
||||
describe('music services', () => {
|
||||
it('saves the services you use, without duplicates, and clears them', async () => {
|
||||
const { token, user } = await createUser(app(), 'listener');
|
||||
expect(user.services).toBeNull();
|
||||
const patch = (payload: object) => app().inject({ method: 'PATCH', url: '/me', headers: bearer(token), payload });
|
||||
const saved = (await patch({ services: ['spotify', 'tidal', 'spotify'], preferredService: 'tidal' })).json();
|
||||
expect(saved.services).toEqual(['spotify', 'tidal']);
|
||||
expect(saved.preferredService).toBe('tidal');
|
||||
expect((await patch({ services: ['napster'] })).statusCode).toBe(400);
|
||||
expect((await patch({ services: null })).json().services).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user