refactor: remove bundled personal portfolio

This commit is contained in:
2026-09-16 10:15:51 +03:30
parent db8f257a98
commit 76ab2d1078
115 changed files with 102 additions and 5460 deletions

View File

@@ -1,6 +1,6 @@
import { expect, test } from '@playwright/test';
const caseStudyPath = '/projects/qlockify';
const caseStudyPath = '/projects/sample-projects';
async function expectDrawerOpen(page: import('@playwright/test').Page) {
const dialog = page.locator('dialog[open]');
@@ -14,7 +14,7 @@ test('a pointer click on the card CTA opens a route-backed drawer and restores t
await page.evaluate(() => {
window.scrollTo({ top: document.body.scrollHeight * 0.35, behavior: 'instant' });
});
const card = page.getByRole('article', { name: 'Qlockify' });
const card = page.getByRole('article', { name: 'A meaningful project' });
const cta = card.getByRole('link', { name: 'View case study' });
// Measure the viewport from which the user actually clicks, after any
// automatic scroll needed to bring the link into view.
@@ -25,8 +25,8 @@ test('a pointer click on the card CTA opens a route-backed drawer and restores t
await expect(page).toHaveURL(new RegExp(`${caseStudyPath}$`));
const dialog = await expectDrawerOpen(page);
await expect(dialog.getByRole('button', { name: 'Close case study' })).toBeFocused();
await expect(card.getByRole('link', { name: /Open the live Qlockify/ })).toHaveAttribute('target', '_blank');
await expect(card.getByRole('link', { name: /Open the live Qlockify/ })).toHaveAttribute('rel', 'noopener noreferrer');
await expect(card.getByRole('link', { name: /Open the live A meaningful project/ })).toHaveAttribute('target', '_blank');
await expect(card.getByRole('link', { name: /Open the live A meaningful project/ })).toHaveAttribute('rel', 'noopener noreferrer');
await page.keyboard.press('Escape');
await expect(page).toHaveURL(/\/$/);
@@ -39,12 +39,12 @@ test('a pointer click on the card CTA opens a route-backed drawer and restores t
test('a shared route opens over the portfolio and adjacent navigation replaces history', async ({ page }) => {
await page.goto(caseStudyPath, { waitUntil: 'domcontentloaded' });
const dialog = await expectDrawerOpen(page);
await expect(page.getByRole('region', { name: 'Products I\'ve Brought to Life' })).toBeAttached();
await expect(page.getByRole('region', { name: 'Things I have built' })).toBeAttached();
const historyLength = await page.evaluate(() => history.length);
await dialog.getByRole('link', { name: /Next project Guilan ACE/ }).click();
await expect(page).toHaveURL(/\/projects\/guilan-ace$/);
await expect(dialog.getByRole('heading', { name: 'Guilan ACE', level: 1 })).toBeVisible();
await dialog.getByRole('link', { name: /Next project Another project/ }).click();
await expect(page).toHaveURL(/\/projects\/another-project$/);
await expect(dialog.getByRole('heading', { name: 'Another project', level: 1 })).toBeVisible();
expect(await page.evaluate(() => history.length)).toBe(historyLength);
await dialog.getByRole('button', { name: 'Close case study' }).click();
await expect(page).toHaveURL(/\/$/);
@@ -55,7 +55,7 @@ test('share fallback, copy feedback, focus containment, and the localized RTL ro
// the DOM and are covered separately through the supported-share branch.
await page.addInitScript(() => Object.defineProperty(navigator, 'share', { configurable: true, value: undefined }));
await context.grantPermissions(['clipboard-read', 'clipboard-write']);
await page.goto('/fa/projects/qlockify', { waitUntil: 'domcontentloaded' });
await page.goto('/fa/projects/sample-projects', { waitUntil: 'domcontentloaded' });
const dialog = await expectDrawerOpen(page);
await expect(page.locator('html')).toHaveAttribute('dir', 'rtl');
await expect(dialog.getByRole('button', { name: 'بستن مطالعه موردی' })).toBeFocused();
@@ -65,7 +65,7 @@ test('share fallback, copy feedback, focus containment, and the localized RTL ro
await expect(shareDialog).toBeVisible();
await shareDialog.getByRole('button', { name: 'کپی پیوند' }).click();
await expect(shareDialog.getByText('پیوند کپی شد', { exact: true }).first()).toBeVisible();
expect(await page.evaluate(() => navigator.clipboard.readText())).toMatch(/\/fa\/projects\/qlockify$/);
expect(await page.evaluate(() => navigator.clipboard.readText())).toMatch(/\/fa\/projects\/sample-projects$/);
await shareDialog.getByRole('button', { name: 'بستن گزینه‌های اشتراک‌گذاری' }).click();
await expect(dialog.getByRole('button', { name: 'اشتراک‌گذاری این مطالعه موردی' })).toBeFocused();
@@ -88,18 +88,18 @@ test('the gallery serves original media and opens an accessible full-screen view
const drawer = await expectDrawerOpen(page);
const stage = drawer.getByRole('button', { name: /Open full-screen image/ });
const selectedImage = stage.getByRole('img');
await expect(selectedImage).toHaveAttribute('src', '/images/screenshots/qlockify/qlockify-landing.png');
await expect(selectedImage).toHaveAttribute('src', '/images/portfolio-placeholder.svg');
await stage.click();
const viewer = page.getByRole('dialog', { name: 'Full-screen project gallery' });
await expect(viewer).toBeVisible();
await expect(viewer.getByText('1 of 8')).toBeVisible();
await expect(viewer.getByText('1 of 2')).toBeVisible();
if (isMobile) {
await viewer.getByRole('button', { name: /^Show image 2:/ }).click();
} else {
await viewer.getByRole('button', { name: 'Next image' }).click();
}
await expect(viewer.getByText('2 of 8')).toBeVisible();
await expect(viewer.getByText('2 of 2')).toBeVisible();
await viewer.getByRole('button', { name: 'Close full-screen image' }).click();
await expect(stage).toBeFocused();
});