beeeeg update
Some checks failed
Test and deploy staging / staging (push) Has been cancelled

This commit is contained in:
2026-09-23 04:15:10 +00:00
parent 487eff5bb2
commit d0c7b6548b
135 changed files with 9531 additions and 1777 deletions

28
tests/finder.test.ts Normal file
View File

@@ -0,0 +1,28 @@
import { expect, test } from '@playwright/test';
const path = 'http://localhost:4173/projects/spotify-beatmap-finder';
test('finder is responsive and validates enhanced submissions', async ({ page }) => {
await page.setViewportSize({ width: 390, height: 844 });
await page.goto(path);
await expect(
page.getByRole('heading', { name: 'Spotify Map Finder', exact: true })
).toBeVisible();
expect(await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth)).toBe(
true
);
await page.getByLabel('Song or Spotify URL').fill('spotify:artist:6PUzxtIHkv346yP89NzP9X');
await page.getByRole('button', { name: 'Search' }).click();
await expect(page.getByRole('alert')).toContainText('Unsupported Spotify resource');
await expect(page.getByLabel('Song or Spotify URL')).toHaveValue(
'spotify:artist:6PUzxtIHkv346yP89NzP9X'
);
});
test('finder retains native form behavior', async ({ browser }) => {
const context = await browser.newContext({ javaScriptEnabled: false });
const page = await context.newPage();
await page.goto(path);
await page.getByLabel('Song or Spotify URL').fill('spotify:album:invalid');
await page.getByRole('button', { name: 'Search' }).click();
await expect(page.getByRole('alert')).toContainText('Invalid Spotify ID');
await expect(page.getByLabel('Song or Spotify URL')).toHaveValue('spotify:album:invalid');
await context.close();
});