diff --git a/index.html b/index.html
index af001ff8..0d133396 100644
--- a/index.html
+++ b/index.html
@@ -90,9 +90,9 @@
"name": "Chandigarh Engineering College",
"sameAs": [
"https://en.wikipedia.org/wiki/Chandigarh_Engineering_College",
- "http://cecmohali.org"
+ "https://www.cecmohali.org"
],
- "logo": "http://cecmohali.org/wp-content/themes/cec-mohali/img/logo.jpg",
+ "logo": "https://www.cecmohali.org/public/images/cec-logo%20naac.jpg",
"email": "contact@cecmohali.org",
"address": {
"@type": "PostalAddress",
@@ -133,7 +133,7 @@
"https://github.com/xRahul",
"https://www.facebook.com/xRahulJain",
"https://twitter.com/xRahulJain",
- "http://stackoverflow.com/users/1435626/rahul"
+ "https://stackoverflow.com/users/1435626/rahul"
]
}
diff --git a/tests/seo.spec.ts b/tests/seo.spec.ts
new file mode 100644
index 00000000..7758aec9
--- /dev/null
+++ b/tests/seo.spec.ts
@@ -0,0 +1,61 @@
+import { test, expect } from '@playwright/test';
+
+test('has opengraph and twitter meta tags', async ({ page }) => {
+ await page.goto('/');
+
+ // Verify OpenGraph tags
+ await Promise.all([
+ expect(page.locator('meta[property="og:title"]')).toHaveAttribute(
+ 'content',
+ 'Rahul Jain'
+ ),
+ expect(page.locator('meta[property="og:image"]')).toHaveAttribute(
+ 'content',
+ 'https://rahulja.in/assets/images/rahul-jain.jpg'
+ ),
+ expect(page.locator('meta[property="og:url"]')).toHaveAttribute(
+ 'content',
+ 'https://rahulja.in'
+ ),
+ expect(page.locator('meta[property="og:description"]')).toHaveAttribute(
+ 'content',
+ 'Rahul Jain is a senior software engineer and tech enthusiast living in Singapore'
+ ),
+ expect(page.locator('meta[property="og:site_name"]')).toHaveAttribute(
+ 'content',
+ 'Rahul Jain'
+ ),
+ expect(page.locator('meta[property="og:type"]')).toHaveAttribute(
+ 'content',
+ 'website'
+ ),
+ ]);
+
+ // Verify Twitter tags
+ await Promise.all([
+ expect(page.locator('meta[name="twitter:card"]')).toHaveAttribute(
+ 'content',
+ 'summary'
+ ),
+ expect(page.locator('meta[name="twitter:url"]')).toHaveAttribute(
+ 'content',
+ 'https://rahulja.in'
+ ),
+ expect(page.locator('meta[name="twitter:creator"]')).toHaveAttribute(
+ 'content',
+ '@xRahulJain'
+ ),
+ expect(page.locator('meta[name="twitter:title"]')).toHaveAttribute(
+ 'content',
+ 'Rahul Jain'
+ ),
+ expect(page.locator('meta[name="twitter:description"]')).toHaveAttribute(
+ 'content',
+ 'Rahul Jain is a senior software engineer and tech enthusiast living in Singapore'
+ ),
+ expect(page.locator('meta[name="twitter:image"]')).toHaveAttribute(
+ 'content',
+ 'https://rahulja.in/assets/images/rahul-jain.jpg'
+ ),
+ ]);
+});
diff --git a/tests/structured-data.spec.ts b/tests/structured-data.spec.ts
new file mode 100644
index 00000000..4946efa1
--- /dev/null
+++ b/tests/structured-data.spec.ts
@@ -0,0 +1,33 @@
+import { test, expect } from '@playwright/test';
+
+test('has valid structured data', async ({ page }) => {
+ await page.goto('/');
+
+ const scriptTag = page.locator('script[type="application/ld+json"]');
+ await expect(scriptTag).toBeAttached();
+
+ const scriptContent = await scriptTag.textContent();
+ expect(scriptContent).not.toBeNull();
+
+ const data = JSON.parse(scriptContent as string);
+
+ expect(data['@context']).toBe('http://schema.org');
+ expect(data['@type']).toBe('Person');
+ expect(data.name).toBe('Rahul Jain');
+ expect(data.jobTitle).toBe('Senior Software Engineer');
+ expect(data.url).toBe('https://rahulja.in');
+
+ const expectedSameAs = [
+ 'https://www.linkedin.com/in/xrahuljain',
+ 'https://github.com/xRahul',
+ 'https://www.facebook.com/xRahulJain',
+ 'https://twitter.com/xRahulJain',
+ 'https://stackoverflow.com/users/1435626/rahul',
+ ];
+
+ expect(Array.isArray(data.sameAs)).toBe(true);
+
+ for (const url of expectedSameAs) {
+ expect(data.sameAs).toContain(url);
+ }
+});