12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- export function checkValProps(val: unknown, props: string[]) {
- for(const prop of props)
- expect(val).toHaveProperty(prop);
- }
- export function checkSongProps(songObj: unknown) {
- return checkValProps(songObj, [
- "url",
- "path",
- "lyricsState",
- "id",
- "meta.title",
- "meta.fullTitle",
- "meta.artists",
- ]);
- }
- export function checkAlbumProps(albumObj: unknown) {
- return checkValProps(albumObj, [
- "name",
- "fullTitle",
- "url",
- "coverArt",
- "id",
- "artist",
- ]);
- }
- export function checkArtistProps(artistObj: unknown) {
- return checkValProps(artistObj, [
- "name",
- "url",
- "image",
- "headerImage",
- ]);
- }
- export function checkTranslationProps(translationObj: unknown) {
- return checkValProps(translationObj, [
- "language",
- "id",
- "path",
- "title",
- "url",
- ]);
- }
|