The first public release of Fabled Minstrel #158
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, test, vi, beforeEach } from 'vitest';
|
||||
import { render, screen, fireEvent, waitFor } from '@testing-library/svelte';
|
||||
import PlaylistCard from './PlaylistCard.svelte';
|
||||
import { washTone } from '#lib/playlists/shelf.js';
|
||||
import type { Playlist, PlaylistDetail } from '#lib/api/types.js';
|
||||
|
||||
vi.mock('#lib/auth/store.svelte.js', () => ({
|
||||
@@ -364,10 +365,11 @@ describe('PlaylistCard', () => {
|
||||
expect(screen.getByText(/12\s+tracks/)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('a wide card takes the colour of its lead cover', async () => {
|
||||
test('a wide card takes the colour of its lead cover, toned for its text', async () => {
|
||||
const { container } = render(PlaylistCard, { props: { playlist: mix, shape: 'wide', covers: ['al-7'] } });
|
||||
const card = container.querySelector('[data-shape="wide"] a') as HTMLElement;
|
||||
await waitFor(() => expect(card.style.getPropertyValue('--wash')).toBe('rgb(90 40 130)'));
|
||||
const { r, g, b } = washTone({ r: 90, g: 40, b: 130 });
|
||||
await waitFor(() => expect(card.style.getPropertyValue('--wash')).toBe(`rgb(${r} ${g} ${b})`));
|
||||
});
|
||||
|
||||
test('the shelf heading can carry the refresh line instead of the tile', () => {
|
||||
|
||||
Reference in New Issue
Block a user