diff --git a/src/style.css b/src/style.css index c09e4315..9daaad12 100644 --- a/src/style.css +++ b/src/style.css @@ -82,10 +82,6 @@ body, will-change: transform; } -.display-none { - display: none; -} - @keyframes flip { 0% { transform: rotateY(360deg); diff --git a/tests/animation-verification.spec.ts b/tests/animation-verification.spec.ts index 7123470d..f455babe 100644 --- a/tests/animation-verification.spec.ts +++ b/tests/animation-verification.spec.ts @@ -7,11 +7,17 @@ test('animation container and items exist', async ({ page }) => { const container = page.locator('.swap-animation'); await expect(container).toBeVisible(); - // Initially, before changes, checking for "Software Engineer" text - // The current implementation uses ::before, so the text might be in the display-none span - // or just invisible. - // We just want to ensure the page loads and the container is there. - // After changes, we expect 5 spans. - // For now, let's just verify the container is present. + const spans = container.locator('span'); + await expect(spans).toHaveCount(5); + + const expectedTexts = [ + 'Software Engineer', + 'Avid Reader', + 'Tech Enthusiast', + 'Gamer', + 'Amateur Guitarist', + ]; + + await expect(spans).toHaveText(expectedTexts); }); diff --git a/tests/benchmark.spec.ts b/tests/benchmark.spec.ts index 3ce034b6..3d661e70 100644 --- a/tests/benchmark.spec.ts +++ b/tests/benchmark.spec.ts @@ -31,6 +31,4 @@ test('measure fps of flip animation', async ({ page }) => { }); }); }); - - console.log(`Average FPS: ${fps.toFixed(2)}`); }); diff --git a/tests/e2e.spec.ts b/tests/e2e.spec.ts index e237e7f5..03ce7b88 100644 --- a/tests/e2e.spec.ts +++ b/tests/e2e.spec.ts @@ -1,22 +1,20 @@ import { test, expect } from '@playwright/test'; -test('has title', async ({ page }) => { +test.beforeEach(async ({ page }) => { await page.goto('/'); +}); +test('has title', async ({ page }) => { // Expect a title "to contain" a substring. await expect(page).toHaveTitle(/Rahul Jain/); }); test('has main heading', async ({ page }) => { - await page.goto('/'); - // Expect the main heading to be visible await expect(page.locator('h1.title')).toBeVisible(); }); test('has social links', async ({ page }) => { - await page.goto('/'); - // Check for social links await Promise.all([ expect(page.getByLabel('Stack Overflow')).toBeVisible(), diff --git a/tests/seo.spec.ts b/tests/seo.spec.ts index 7758aec9..a1eeb3e5 100644 --- a/tests/seo.spec.ts +++ b/tests/seo.spec.ts @@ -59,3 +59,46 @@ test('has opengraph and twitter meta tags', async ({ page }) => { ), ]); }); + +test('has favicon and manifest tags', async ({ page }) => { + await page.goto('/'); + + await Promise.all([ + expect(page.locator('link[rel="manifest"]')).toHaveAttribute( + 'href', + '/manifest.json' + ), + expect(page.locator('link[rel="apple-touch-icon"]')).toHaveAttribute( + 'href', + '/assets/favicons/apple-touch-icon.png' + ), + expect(page.locator('link[rel="icon"][sizes="16x16"]')).toHaveAttribute( + 'href', + '/assets/favicons/favicon-16x16.png' + ), + expect(page.locator('link[rel="icon"][sizes="32x32"]')).toHaveAttribute( + 'href', + '/assets/favicons/favicon-32x32.png' + ), + expect(page.locator('link[rel="icon"][sizes="96x96"]')).toHaveAttribute( + 'href', + '/assets/favicons/favicon-96x96.png' + ), + expect(page.locator('link[rel="icon"][sizes="128x128"]')).toHaveAttribute( + 'href', + '/assets/favicons/favicon-128.png' + ), + expect(page.locator('link[rel="icon"][sizes="192x192"]')).toHaveAttribute( + 'href', + '/assets/favicons/android-chrome-192x192.png' + ), + expect(page.locator('link[rel="mask-icon"]')).toHaveAttribute( + 'href', + '/assets/favicons/safari-pinned-tab.svg' + ), + expect(page.locator('link[rel="shortcut icon"]')).toHaveAttribute( + 'href', + '/assets/favicons/favicon.ico' + ), + ]); +});