From efff9224f2bc36570829adbeb7d7bdc088bd9637 Mon Sep 17 00:00:00 2001 From: spences10 Date: Sun, 9 Apr 2023 15:41:56 +0100 Subject: [PATCH] test: :white_check_mark: remove route tests --- tests/article.test.ts | 129 ------------------------------------- tests/blog-posting.test.ts | 41 ------------ tests/news-article.test.ts | 0 tests/web-page.test.ts | 0 4 files changed, 170 deletions(-) delete mode 100644 tests/article.test.ts delete mode 100644 tests/blog-posting.test.ts delete mode 100644 tests/news-article.test.ts delete mode 100644 tests/web-page.test.ts diff --git a/tests/article.test.ts b/tests/article.test.ts deleted file mode 100644 index 4c87e2b..0000000 --- a/tests/article.test.ts +++ /dev/null @@ -1,129 +0,0 @@ -// import { expect, test } from '@playwright/test' -// import { testSeoTags } from './utils' - -// const pageURL = 'http://localhost:4173/' - -// test.describe('Article page', () => { -// test.beforeEach(async ({ page }) => { -// await page.goto('/article') -// }) - -// test('page has h1', async ({ page }) => { -// expect(await page.textContent('h1')).toBe('Article Example') -// }) - -// test('head has canonical', async ({ page }) => { -// await page.goto('/article') -// const metaDescription = page.locator('link[rel="canonical"]') -// await expect(metaDescription).toHaveAttribute( -// 'href', -// 'https://example.com/article' -// ) -// }) - -// test('head has common SEO tags', async ({ page }) => { -// await testSeoTags(page, pageURL) -// }) - -// test('schema.org script is generated correctly', async ({ -// page, -// }) => { -// await page.goto('/article') -// const jsonLdScriptElement = page.locator( -// 'script[type="application/ld+json"]' -// ) -// const jsonLdContent = await jsonLdScriptElement.textContent() -// if (jsonLdContent) { -// const expectedJsonLd = { -// '@context': 'https://schema.org', -// '@type': 'Article', -// author: { -// '@type': 'Person', -// name: 'John Doe', -// url: 'https://example.com/authors/john-doe', -// }, -// dateModified: '2023-04-05T12:00:00Z', -// datePublished: '2023-04-05T10:00:00Z', -// description: 'This is a sample article.', -// headline: 'Article', -// image: 'https://example.com/images/article-image.jpg', -// name: 'Article', -// publisher: { -// '@type': 'Organization', -// logo: '', -// name: '', -// }, -// url: 'https://example.com/article', -// } - -// expect(JSON.parse(jsonLdContent)).toEqual(expectedJsonLd) -// } -// }) - -// test('schema.org script has the correct @type', async ({ -// page, -// }) => { -// await page.goto('/article') -// const jsonLdScriptElement = page.locator( -// 'script[type="application/ld+json"]' -// ) -// const jsonLdContent = await jsonLdScriptElement.textContent() -// if (jsonLdContent) { -// const jsonLdData = JSON.parse(jsonLdContent) -// expect(jsonLdData['@type']).toBe('Article') -// } -// }) - -// test('schema.org script has the correct author data', async ({ -// page, -// }) => { -// await page.goto('/article') -// const jsonLdScriptElement = page.locator( -// 'script[type="application/ld+json"]' -// ) -// const jsonLdContent = await jsonLdScriptElement.textContent() -// if (jsonLdContent) { -// const jsonLdData = JSON.parse(jsonLdContent) -// const authorData = jsonLdData.author -// expect(authorData).toEqual({ -// '@type': 'Person', -// name: 'John Doe', -// url: 'https://example.com/authors/john-doe', -// }) -// } -// }) - -// test('schema.org script has the correct publisher data', async ({ -// page, -// }) => { -// await page.goto('/article') -// const jsonLdScriptElement = page.locator( -// 'script[type="application/ld+json"]' -// ) -// const jsonLdContent = await jsonLdScriptElement.textContent() -// if (jsonLdContent) { -// const jsonLdData = JSON.parse(jsonLdContent) -// const publisherData = jsonLdData.publisher -// expect(publisherData).toEqual({ -// '@type': 'Organization', -// name: '', -// logo: '', -// }) -// } -// }) - -// test('schema.org script has the correct datePublished and dateModified', async ({ -// page, -// }) => { -// await page.goto('/article') -// const jsonLdScriptElement = page.locator( -// 'script[type="application/ld+json"]' -// ) -// const jsonLdContent = await jsonLdScriptElement.textContent() -// if (jsonLdContent) { -// const jsonLdData = JSON.parse(jsonLdContent) -// expect(jsonLdData.datePublished).toBe('2023-04-05T10:00:00Z') -// expect(jsonLdData.dateModified).toBe('2023-04-05T12:00:00Z') -// } -// }) -// }) diff --git a/tests/blog-posting.test.ts b/tests/blog-posting.test.ts deleted file mode 100644 index be18eb4..0000000 --- a/tests/blog-posting.test.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { expect, test } from '@playwright/test' - -test.describe('Blog Posting page', () => { - let pageURL: string - - test.beforeEach(async ({ page }) => { - pageURL = 'https://example.com/blog-post' - }) - - test('page has h1', async ({ page }) => { - await page.goto(pageURL) - const h1Element = page.locator('h1') - await expect(h1Element).toHaveText('Blog Post Title') - }) - - test('head has canonical', async ({ page }) => { - await page.goto(pageURL) - const metaDescription = page.locator('link[rel="canonical"]') - await expect(metaDescription).toHaveAttribute('href', pageURL) - }) - - test('schema.org script is generated correctly', async ({ - page, - }) => { - await page.goto(pageURL) - const jsonLdScriptElement = page.locator( - 'script[type="application/ld+json"]' - ) - const jsonLdContent = await jsonLdScriptElement.textContent() - if (jsonLdContent) { - const expectedJsonLd = { - '@context': 'https://schema.org', - '@type': 'BlogPosting', - // Add the expected JSON-LD properties for your blog posting page here - } - expect(JSON.parse(jsonLdContent)).toEqual(expectedJsonLd) - } - }) - - // Add more tests as needed for your specific blog posting page -}) diff --git a/tests/news-article.test.ts b/tests/news-article.test.ts deleted file mode 100644 index e69de29..0000000 diff --git a/tests/web-page.test.ts b/tests/web-page.test.ts deleted file mode 100644 index e69de29..0000000