From 2ef2b39fbcf6dacc993967c30f6bbe8f6ef0c15b Mon Sep 17 00:00:00 2001 From: sharevb Date: Sun, 16 Jun 2024 13:37:33 +0200 Subject: [PATCH] feat: test that all tools are loading --- src/tools/all-tools.e2e.spec.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/tools/all-tools.e2e.spec.ts diff --git a/src/tools/all-tools.e2e.spec.ts b/src/tools/all-tools.e2e.spec.ts new file mode 100644 index 00000000..2a11bdd1 --- /dev/null +++ b/src/tools/all-tools.e2e.spec.ts @@ -0,0 +1,15 @@ +import { expect, test } from '@playwright/test'; +import _ from 'lodash'; +import { toolsByCategory } from './index'; + +for (const tool of _.flatten(toolsByCategory.map(category => category.components))) { + test.describe(`Tool - ${tool.name}`, () => { + test.beforeEach(async ({ page }) => { + await page.goto(tool.path); + }); + + test('Loads correctly (has correct title)', async ({ page }) => { + await expect(page).toHaveTitle(`${tool.name} - IT Tools`); + }); + }); +}