Skip to content

Commit

Permalink
Fixed some missed urls
Browse files Browse the repository at this point in the history
  • Loading branch information
arpargo committed Aug 18, 2023
1 parent 0e7525b commit a6de8e5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
6 changes: 5 additions & 1 deletion frontend/tet/admin/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/'] },
});
14 changes: 8 additions & 6 deletions frontend/tet/admin/src/__tests__/utils/backend/backend-nocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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/',

Check failure on line 92 in frontend/tet/admin/src/__tests__/utils/backend/backend-nocks.ts

View workflow job for this annotation

GitHub Actions / Test

Unexpected string concatenation
name: {
fi: 'Tee oikeita töitä',
},
Expand All @@ -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/',

Check failure on line 112 in frontend/tet/admin/src/__tests__/utils/backend/backend-nocks.ts

View workflow job for this annotation

GitHub Actions / Test

Unexpected string concatenation
name: {
fi: 'Soveltuu näkövammaisille',
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/tet/shared/src/backend-api/linked-events-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit a6de8e5

Please sign in to comment.