From a6de8e5970a3855c6417b1c0dbef51bec62a7a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arto=20P=C3=A4rssinen?= Date: Fri, 18 Aug 2023 10:52:52 +0300 Subject: [PATCH] Fixed some missed urls --- frontend/tet/admin/next.config.js | 6 +++++- .../src/__tests__/utils/backend/backend-nocks.ts | 14 ++++++++------ .../shared/src/backend-api/linked-events-api.ts | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/frontend/tet/admin/next.config.js b/frontend/tet/admin/next.config.js index 50bbca6478..f58caba6a8 100644 --- a/frontend/tet/admin/next.config.js +++ b/frontend/tet/admin/next.config.js @@ -3,4 +3,8 @@ const { i18n } = require('./next-i18next.config'); const { parsed: env } = require('dotenv').config({ path: '../../../.env.tet', }); -module.exports = nextConfig({ i18n, env, images: { domains: ['linkedevents-api.dev.hel.ninja'] } }); +module.exports = nextConfig({ + i18n, + env, + images: { domains: ['https://linkedevents-api-dev.agw.arodevtest.hel.fi/'] }, +}); diff --git a/frontend/tet/admin/src/__tests__/utils/backend/backend-nocks.ts b/frontend/tet/admin/src/__tests__/utils/backend/backend-nocks.ts index 296b21e7c1..d7138cdb36 100644 --- a/frontend/tet/admin/src/__tests__/utils/backend/backend-nocks.ts +++ b/frontend/tet/admin/src/__tests__/utils/backend/backend-nocks.ts @@ -6,6 +6,8 @@ import { TetEvent, TetEvents } from 'tet-shared/types/linkedevents'; const fakeObjectFactory = new FakeObjectFactory(); +const linkedEventsApiBaseUrl = 'https://linkedevents-api-dev.agw.arodevtest.hel.fi/v1'; + // disable unnecessary axios' expected error messages // https://stackoverflow.com/questions/44467657/jest-better-way-to-disable-console-inside-unit-tests let consoleSpy: jest.SpyInstance; @@ -52,7 +54,7 @@ export const expectToGetEventssErrorFromBackend = (errorCode: 400 | 404 | 500): }; export const expectPlacesFromLinkedEvents = (): nock.Scope => - nock('https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1') + nock(linkedEventsApiBaseUrl) .get('/place/?show_all_places=true&nocache=true&text=') .reply( 200, @@ -64,7 +66,7 @@ export const expectPlacesFromLinkedEvents = (): nock.Scope => ); export const expectKeyWordsFromLinkedEvents = (): nock.Scope => - nock('https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1') + nock(linkedEventsApiBaseUrl) .get('/keyword') .reply( 200, @@ -80,14 +82,14 @@ export const expectKeyWordsFromLinkedEvents = (): nock.Scope => // TODO don't hardcode url // this is needed when testing the Editor form and can be refactored then export const expectWorkingMethodsFromLinkedEvents = (): nock.Scope => - nock('https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1') + nock(linkedEventsApiBaseUrl) .get('/keyword_set/tet:wm/?include=keywords') .reply( 200, { keywords: [ { - '@id': 'https://linkedevents-api-dev.agw.arodevtest.hel.fi/v1/keyword/tet:4/', + '@id': linkedEventsApiBaseUrl + '/keyword/tet:4/', name: { fi: 'Tee oikeita töitä', }, @@ -100,14 +102,14 @@ export const expectWorkingMethodsFromLinkedEvents = (): nock.Scope => // TODO don't hardcode url // this is needed when testing the Editor form and can be refactored then export const expectAttributesFromLinkedEvents = (): nock.Scope => - nock('https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1') + nock(linkedEventsApiBaseUrl) .get('/keyword_set/tet:attr/?include=keywords') .reply( 200, { keywords: [ { - '@id': 'https://linkedevents-api-dev.agw.arodevtest.hel.fi/v1/keyword/tet:1/', + '@id': linkedEventsApiBaseUrl + '/keyword/tet:1/', name: { fi: 'Soveltuu näkövammaisille', }, diff --git a/frontend/tet/shared/src/backend-api/linked-events-api.ts b/frontend/tet/shared/src/backend-api/linked-events-api.ts index de57c099e8..59a799651b 100644 --- a/frontend/tet/shared/src/backend-api/linked-events-api.ts +++ b/frontend/tet/shared/src/backend-api/linked-events-api.ts @@ -18,7 +18,7 @@ type Keyword = IdObject & { const linkedEvents = Axios.create({ baseURL: process.env.NEXT_PUBLIC_LINKEDEVENTS_URL || - 'https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1', + 'https://linkedevents-api-dev.agw.arodevtest.hel.fi/v1', timeout: 4000, headers: { 'Content-Type': 'application/json',