From d1c409c6f33005467f426771593c2c7eb00eef9b Mon Sep 17 00:00:00 2001 From: Stalgia Grigg Date: Tue, 23 Jul 2024 17:58:23 -0700 Subject: [PATCH] REVERT: revert accidental commit directly to develop --- client/package.json | 3 +- client/tests/e2e/scripts/takeSnapshots.js | 144 ---------------------- package.json | 1 - 3 files changed, 1 insertion(+), 147 deletions(-) delete mode 100644 client/tests/e2e/scripts/takeSnapshots.js diff --git a/client/package.json b/client/package.json index d219798f4..1e167c527 100644 --- a/client/package.json +++ b/client/package.json @@ -11,8 +11,7 @@ "lint": "eslint --ext js,jsx .", "storybook": "start-storybook -p 6006", "build-storybook": "build-storybook", - "lighthouse": "lhci autorun", - "record-routes": "DOTENV_CONFIG_PATH=../config/test.env node -r dotenv/config tests/e2e/scripts/takeSnapshots.js" + "lighthouse": "lhci autorun" }, "repository": { "type": "git", diff --git a/client/tests/e2e/scripts/takeSnapshots.js b/client/tests/e2e/scripts/takeSnapshots.js deleted file mode 100644 index e51712477..000000000 --- a/client/tests/e2e/scripts/takeSnapshots.js +++ /dev/null @@ -1,144 +0,0 @@ -/* eslint-disable no-console */ -const puppeteer = require('puppeteer'); -const fs = require('fs').promises; -const path = require('path'); -const prettier = require('prettier'); - -const { - ApolloClient, - InMemoryCache, - gql, - HttpLink -} = require('@apollo/client'); -const getPage = require('../../util/getPage'); -const { setup, teardown } = require('../../util/getPage'); - -const BASE_URL = 'http://localhost:3000'; -const SNAPSHOTS_DIR = path.join(__dirname, 'snapshots'); - -const client = new ApolloClient({ - link: new HttpLink({ uri: `${BASE_URL}/api/graphql` }), - cache: new InMemoryCache() -}); - -async function getReportRoutesForTestPlanVersions() { - const maxValidTestPlanReportId = 19; - return Array.from( - { length: maxValidTestPlanReportId }, - (_, i) => `/test-plan-report/${i + 1}` - ); -} - -async function getBaseRoutes() { - return [ - '/', - '/signup-instructions', - '/account/settings', - '/test-queue', - '/reports', - '/candidate-review', - '/data-management', - '/invalid-request', - '/404' - // TODO - // '/run/:runId', - // '/test-plan-report/:testPlanReportId', - // '/test-review/:testPlanVersionId', - // '/candidate-test-plan/:testPlanVersionId/:atId', - ]; -} - -async function getDataManagementRoutes() { - const query = gql` - query GetTestPlanDirectories { - testPlans { - id - directory - } - } - `; - - const { data } = await client.query({ query }); - return data.testPlans.map( - ({ directory }) => `/data-management/${directory}/` - ); -} - -async function takeSnapshot(browser, role, route) { - const page = await browser.newPage(); - try { - await page.goto(`${BASE_URL}${route}`, { waitUntil: 'networkidle0' }); - - // Remove all