mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 14:35:41 +00:00
5d53a63553
* fix(search): hide search3 artists with zero albums * docs: changelog and credits for search zero-album filter (PR #697)
19 lines
714 B
TypeScript
19 lines
714 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { filterSearchArtistsWithNoAlbums } from './subsonicSearch';
|
|
import type { SubsonicArtist } from './subsonicTypes';
|
|
|
|
describe('filterSearchArtistsWithNoAlbums', () => {
|
|
it('removes artists with albumCount 0', () => {
|
|
const artists: SubsonicArtist[] = [
|
|
{ id: '1', name: 'Real', albumCount: 2 },
|
|
{ id: '2', name: 'Ghost', albumCount: 0 },
|
|
];
|
|
expect(filterSearchArtistsWithNoAlbums(artists)).toEqual([artists[0]]);
|
|
});
|
|
|
|
it('keeps artists when albumCount is omitted', () => {
|
|
const artists: SubsonicArtist[] = [{ id: '1', name: 'Unknown count' }];
|
|
expect(filterSearchArtistsWithNoAlbums(artists)).toEqual(artists);
|
|
});
|
|
});
|