From a4dc8815e7477d3303b7b17d8384299474e7d6ce Mon Sep 17 00:00:00 2001 From: Daniel Zamora Date: Fri, 21 Jun 2024 05:42:59 -0400 Subject: [PATCH] fixup --- playwright.config.cjs | 5 ++++- serverless.yml | 1 + serverless/src/util/cmr/doSearchRequest.jsx | 2 ++ .../AuthCallbackContainer/AuthCallbackContainer.jsx | 1 - tests/e2e/authentication/authentication.spec.js | 2 +- tests/e2e/collection_list/collection_list.spec.js | 2 +- tests/e2e/history/history.spec.js | 4 ++-- tests/e2e/map/map.spec.js | 12 ++++++------ tests/e2e/timeline/timeline.spec.js | 6 +++--- 9 files changed, 20 insertions(+), 15 deletions(-) diff --git a/playwright.config.cjs b/playwright.config.cjs index 2354a1e79d..54c2af60a9 100644 --- a/playwright.config.cjs +++ b/playwright.config.cjs @@ -23,7 +23,10 @@ module.exports = defineConfig({ /* Reporter to use. See https://playwright.dev/docs/test-reporters */ reporter: [ ['list'], - ['html'] + ['html', { + outputFolder: 'playwright-report', + open: 'never' + }] ], /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { diff --git a/serverless.yml b/serverless.yml index bb83109df9..b096caa353 100644 --- a/serverless.yml +++ b/serverless.yml @@ -9,6 +9,7 @@ provider: endpointType: PRIVATE memorySize: 128 environment: + NODE_ENV: development # Variables for new Encrypted database databaseEndpoint: Fn::ImportValue: ${self:provider.stage}-EncryptedDatabaseEndpoint diff --git a/serverless/src/util/cmr/doSearchRequest.jsx b/serverless/src/util/cmr/doSearchRequest.jsx index 3a2f649efd..c598dabc03 100644 --- a/serverless/src/util/cmr/doSearchRequest.jsx +++ b/serverless/src/util/cmr/doSearchRequest.jsx @@ -75,6 +75,8 @@ export const doSearchRequest = async ({ console.log(`Request ${requestId} completed external request in [reported: ${cmrTook} ms, observed: ${elapsedTime} ms]`) + console.log("🚀 ~ JSON.stringify(data:", JSON.stringify(data)) + return { statusCode: response.status, headers: { diff --git a/static/src/js/containers/AuthCallbackContainer/AuthCallbackContainer.jsx b/static/src/js/containers/AuthCallbackContainer/AuthCallbackContainer.jsx index 990eee7109..e740ec52c9 100644 --- a/static/src/js/containers/AuthCallbackContainer/AuthCallbackContainer.jsx +++ b/static/src/js/containers/AuthCallbackContainer/AuthCallbackContainer.jsx @@ -83,7 +83,6 @@ export const AuthCallbackContainer = ({ // Set the authToken cookie set('authToken', jwt) - console.log("🚀 ~ useEffect ~ jwt:", jwt) // Redirect the user to the correct location window.location.replace(redirect) diff --git a/tests/e2e/authentication/authentication.spec.js b/tests/e2e/authentication/authentication.spec.js index 9db6b7c1a3..330087f458 100644 --- a/tests/e2e/authentication/authentication.spec.js +++ b/tests/e2e/authentication/authentication.spec.js @@ -13,7 +13,7 @@ const expectedCollectionCount = 6 test.describe('Authentication', () => { test.beforeEach(async ({ page }) => { await page.route('**/*.{png,jpg,jpeg}', (route) => route.abort()) - await page.route(/collections/, async (route) => { + await page.route(/collections$/, async (route) => { await route.fulfill({ json: collectionFixture.body, headers: collectionFixture.headers diff --git a/tests/e2e/collection_list/collection_list.spec.js b/tests/e2e/collection_list/collection_list.spec.js index 38db23aa3a..d652261c90 100644 --- a/tests/e2e/collection_list/collection_list.spec.js +++ b/tests/e2e/collection_list/collection_list.spec.js @@ -5,7 +5,7 @@ import singleCollection from './__mocks__/single_collection.json' with { type: ' test.describe('Collection List Behavior', () => { test.beforeEach(async ({ page }) => { await page.route('**/*.{png,jpg,jpeg}', (route) => route.abort()) - await page.route(/collections/, async (route) => { + await page.route(/collections.json/, async (route) => { await route.fulfill({ json: singleCollection.body, headers: singleCollection.headers diff --git a/tests/e2e/history/history.spec.js b/tests/e2e/history/history.spec.js index eb571878a1..a763324828 100644 --- a/tests/e2e/history/history.spec.js +++ b/tests/e2e/history/history.spec.js @@ -20,7 +20,7 @@ test.describe('History', () => { test.beforeEach(async ({ page, context }) => { const granuleHits = 1 - await page.route(/collections/, async (route) => { + await page.route(/collections$/, async (route) => { await route.fulfill({ json: collectionsSearchBody, headers: { @@ -40,7 +40,7 @@ test.describe('History', () => { }) }) - await page.route(/timeline/, async (route) => { + await page.route(/timeline$/, async (route) => { await route.fulfill({ json: timeline.body }) diff --git a/tests/e2e/map/map.spec.js b/tests/e2e/map/map.spec.js index e93d43a23c..4ff3a31247 100644 --- a/tests/e2e/map/map.spec.js +++ b/tests/e2e/map/map.spec.js @@ -820,9 +820,9 @@ test.describe('Map interactions', () => { // Point const pointValues = { - chromium: 'margin-left: -12px; margin-top: -41px; width: 25px; height: 41px; transform: translate3d(427px, 182px, 0px); z-index: 182; outline: none;', - firefox: 'margin-left: -12px; margin-top: -41px; width: 25px; height: 41px; transform: translate3d(427px, 182px, 0px); z-index: 182; outline: none;', - webkit: 'margin-left: -12px; margin-top: -41px; width: 25px; height: 41px; transform: translate3d(427px, 182px, 0px); z-index: 182; outline: currentcolor;' + chromium: 'margin-left: -12px; margin-top: -41px; width: 25px; height: 41px; transform: translate3d(427px, 182px, 0px); z-index: 182; outline-style: none;', + firefox: 'margin-left: -12px; margin-top: -41px; width: 25px; height: 41px; transform: translate3d(427px, 182px, 0px); z-index: 182; outline-style: none;', + webkit: 'margin-left: -12px; margin-top: -41px; width: 25px; height: 41px; transform: translate3d(427px, 182px, 0px); z-index: 182; outline-style: none;' } await expect(page.locator('.leaflet-marker-icon.leaflet-interactive').nth(0)).toHaveAttribute('style', pointValues[browser]) @@ -1413,7 +1413,7 @@ test.describe('Map interactions', () => { }) }) - await page.route(/autocomplete/, async (route) => { + await page.route(/autocomplete$/, async (route) => { await route.fulfill({ json: { feed: { entry: [] } } }) @@ -1599,7 +1599,7 @@ test.describe('Map interactions', () => { }) }) - await page.route(/autocomplete/, async (route) => { + await page.route(/autocomplete$/, async (route) => { await route.fulfill({ json: { feed: { entry: [] } } }) @@ -1668,7 +1668,7 @@ test.describe('Map interactions', () => { } }) - await page.route(/autocomplete/, async (route) => { + await page.route(/autocomplete$/, async (route) => { await route.fulfill({ json: { feed: { entry: [] } } }) diff --git a/tests/e2e/timeline/timeline.spec.js b/tests/e2e/timeline/timeline.spec.js index 9928b50c51..7dbb443e9d 100644 --- a/tests/e2e/timeline/timeline.spec.js +++ b/tests/e2e/timeline/timeline.spec.js @@ -23,7 +23,7 @@ test.describe('Timeline spec', () => { const authHeaders = getAuthHeaders() - await page.route(/collections/, async (route) => { + await page.route(/collections$/, async (route) => { await route.fulfill({ json: collectionFixture.body, headers: collectionFixture.headers @@ -37,7 +37,7 @@ test.describe('Timeline spec', () => { }) }) - await page.route(/timeline/, async (route) => { + await page.route(/timeline$/, async (route) => { await route.fulfill({ json: timeline.body, headers: authHeaders @@ -72,7 +72,7 @@ test.describe('Timeline spec', () => { }) }) - await page.goto('/projects?p=!C1443528505-LAADS&sb=-77.15071678161621%2C38.78817179999825%2C-76.89801406860352%2C38.99784152603538&lat=37.64643450971326&long=-77.407470703125&zoom=7qt=2020-01-06T04%3A15%3A27.310Z%2C2020-01-13T07%3A32%3A50.962Z&ff=Map%20Imagery&tl=1563377338!4!!') + await page.goto('/projects?p=!C1443528505-LAADS&sb=-77.15071%2C38.78817%2C-76.89801%2C38.99784&lat=37.64643&long=-77.40747&zoom=7qt=2020-01-06T04%3A15%3A27.310Z%2C2020-01-13T07%3A32%3A50.962Z&ff=Map%20Imagery&tl=1563377338!4!!') // Click the back to search button await page.getByTestId('back-to-search-button').click()