test(web): a wide card's wash is its cover colour as washTone tones it
release / web (push) Successful in 1m45s
release / go (push) Successful in 2m10s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 4m23s
release / android (push) Successful in 4m58s
release / Build signed APK (push) Successful in 5m36s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 40s
release / Verify release artifacts (tag releases only) (push) Skipped
release / web (push) Successful in 1m45s
release / go (push) Successful in 2m10s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 4m23s
release / android (push) Successful in 4m58s
release / Build signed APK (push) Successful in 5m36s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 40s
release / Verify release artifacts (tag releases only) (push) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { describe, expect, test, vi, beforeEach } from 'vitest';
|
import { describe, expect, test, vi, beforeEach } from 'vitest';
|
||||||
import { render, screen, fireEvent, waitFor } from '@testing-library/svelte';
|
import { render, screen, fireEvent, waitFor } from '@testing-library/svelte';
|
||||||
import PlaylistCard from './PlaylistCard.svelte';
|
import PlaylistCard from './PlaylistCard.svelte';
|
||||||
|
import { washTone } from '#lib/playlists/shelf.js';
|
||||||
import type { Playlist, PlaylistDetail } from '#lib/api/types.js';
|
import type { Playlist, PlaylistDetail } from '#lib/api/types.js';
|
||||||
|
|
||||||
vi.mock('#lib/auth/store.svelte.js', () => ({
|
vi.mock('#lib/auth/store.svelte.js', () => ({
|
||||||
@@ -364,10 +365,11 @@ describe('PlaylistCard', () => {
|
|||||||
expect(screen.getByText(/12\s+tracks/)).toBeInTheDocument();
|
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 { container } = render(PlaylistCard, { props: { playlist: mix, shape: 'wide', covers: ['al-7'] } });
|
||||||
const card = container.querySelector('[data-shape="wide"] a') as HTMLElement;
|
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', () => {
|
test('the shelf heading can carry the refresh line instead of the tile', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user