Something went wrong. Try again.
atproto Thingiverse but good
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104import { expect, test } from '@playwright/test';
test('home page shows the product shell and discovery feed with reusable thing cards', async ({ page }) => { await page.goto('/');
// Persistent product shell. await expect(page.getByRole('link', { name: 'Polymodel home' })).toBeVisible(); await expect(page.getByRole('searchbox', { name: 'Search Polymodel' })).toBeVisible(); await expect(page.getByRole('link', { name: 'Publish' })).toBeVisible(); await expect(page.getByRole('banner').getByRole('button', { name: 'Sign in' })).toBeVisible();
// Discovery feed selector (Hot default; Following now resolves to a signed-out empty state). await expect(page.getByRole('tab', { name: 'Hot' })).toHaveAttribute('aria-selected', 'true'); await expect(page.getByRole('tab', { name: 'Recent' })).toHaveAttribute('aria-selected', 'false'); await expect(page.getByRole('tab', { name: 'Following' })).toHaveAttribute('aria-selected', 'false');
// No inline catalog search box on the home surface anymore. await expect(page.getByRole('searchbox', { name: 'Search model projects' })).toHaveCount(0);
const results = page.getByLabel('Browse results'); await expect(results).toBeVisible(); expect(await results.getByRole('article').count()).toBeGreaterThanOrEqual(3); await expect(page.getByRole('heading', { name: 'Parametric enclosure kit' })).toBeVisible(); await expect(page.getByRole('link', { name: 'Ari Chen @ari.model.tools' })).toBeVisible(); await expect(page.getByText('#parametric')).toBeVisible(); await expect(page.getByText('3 models')).toBeVisible(); await expect(page.getByText('18 parts')).toBeVisible(); await expect(page.getByRole('img', { name: 'Rendered preview of a parametric electronics enclosure' })).toBeVisible();
await expect(page.getByRole('heading', { name: 'Untitled thing' })).toBeVisible(); await expect(page.getByText('@mira.tools')).toBeVisible();
await expect(page.getByRole('heading', { name: 'Modular calibration tower' })).toBeVisible(); expect(await page.getByRole('img', { name: 'Blueprint placeholder for missing preview media' }).count()).toBeGreaterThanOrEqual(2);
await expect(page.getByLabel('Browse results placeholder')).toHaveCount(0); await expect(page.getByText('Empty')).toHaveCount(0);});
test('global shell search navigates to /search', async ({ page }) => { await page.goto('/');
// Gate on a rendered feed card so the shell has loaded before we use search. // Search is a native GET form, so this works before and after hydration. await expect(page.getByLabel('Browse results').getByRole('article').first()).toBeVisible();
const search = page.getByRole('searchbox', { name: 'Search Polymodel' }); await search.fill('enclosure'); await page.getByRole('button', { name: 'Search' }).click();
await expect(page).toHaveURL(/\/search\?q=enclosure$/); await expect(page.getByRole('region', { name: 'Search', exact: true })).toBeVisible(); await expect(page.getByText('"enclosure"')).toBeVisible(); await expect(page.getByLabel('Search results')).toBeVisible(); await expect(page.getByRole('heading', { name: 'Parametric enclosure kit' })).toBeVisible();});
test('shell header is present on a deep route', async ({ page }) => { await page.goto('/profile');
await expect(page.getByRole('link', { name: 'Polymodel home' })).toBeVisible(); await expect(page.getByRole('searchbox', { name: 'Search Polymodel' })).toBeVisible(); await expect(page.getByRole('link', { name: 'Publish' })).toBeVisible();});
test('placeholder routes resolve with honest, non-faked content', async ({ page }) => { await page.goto('/search'); await expect(page.getByRole('region', { name: 'Search', exact: true })).toBeVisible(); await expect(page.getByRole('heading', { name: 'Search from the header' })).toBeVisible(); await expect(page.getByText('Find indexed projects by name, tag, author, or description.')).toBeVisible();});
test('home thing cards remain readable at narrow widths', async ({ page }) => { await page.setViewportSize({ width: 390, height: 900 }); await page.goto('/');
await expect(page.getByLabel('Browse results')).toBeVisible(); await expect(page.getByRole('heading', { name: 'Parametric enclosure kit' })).toBeVisible(); await expect(page.getByRole('heading', { name: 'Untitled thing' })).toBeVisible(); await expect(page.getByRole('heading', { name: 'Modular calibration tower' })).toBeVisible(); expect(await page.getByRole('img', { name: 'Blueprint placeholder for missing preview media' }).count()).toBeGreaterThanOrEqual(2);});
test('foundation route shows foundation primitives and reusable states', async ({ page }) => { await page.goto('/foundation');
await expect(page.getByRole('heading', { name: 'Foundation', exact: true })).toBeVisible(); await expect(page.getByText('Token and asset check')).toBeVisible(); await expect(page.getByLabel('Foundation primitives')).toBeVisible(); await expect(page.getByLabel('Reusable states')).toBeVisible(); await expect(page.getByText('No projects yet')).toBeVisible(); await expect(page.getByText('Feed unavailable')).toBeVisible();});
test('home page no longer uses workflow roadmap demo copy as the product surface', async ({ page }) => { await page.goto('/');
await expect(page.getByText('Thingiverse on atproto')).toHaveCount(0); await expect(page.getByText('Project lexicon')).toHaveCount(0); await expect(page.getByText('Jira and Confluence')).toHaveCount(0); await expect(page.getByText('Polytoken workflow')).toHaveCount(0); await expect(page.getByText('Front-end foundation')).toHaveCount(0);});