Skip to content

Commit

Permalink
chore: switch to new Platta test Linked Events (#2339)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomas777 authored Oct 25, 2023
1 parent 332e471 commit 0633b1a
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .env.tet.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ HANDLER_URL=https://localhost:3100
NEXT_PUBLIC_BACKEND_URL=https://localhost:8000

# Linked Events
LINKEDEVENTS_URL=https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/
LINKEDEVENTS_URL=https://linkedevents.api.test.hel.ninja/v1/
LINKEDEVENTS_API_KEY=

# Authentication
Expand Down
78 changes: 39 additions & 39 deletions backend/tet/events/tests/data/linked_events_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"fi": "Testaaja"
},
"location": {
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/place/tprek:15417/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/place/tprek:15417/"
},
"description": {
"fi": "test description"
Expand All @@ -20,16 +20,16 @@
"date_published": null,
"keywords": [
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:1/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/tet:1/"
},
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:11/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/tet:11/"
},
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:12/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/tet:12/"
},
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/yso:p3971/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/yso:p3971/"
}
],
"custom_data": {
Expand Down Expand Up @@ -59,20 +59,20 @@
{
"id": "tet:af7w5v5m6e",
"location": {
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/place/tprek:15417/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/place/tprek:15417/"
},
"keywords": [
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:1/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/tet:1/"
},
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:11/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/tet:11/"
},
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:12/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/tet:12/"
},
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/yso:p3971/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/yso:p3971/"
}
],
"registration": null,
Expand Down Expand Up @@ -155,7 +155,7 @@
"short_description": {
"fi": "TET-paikan kuvaus"
},
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/event/tet:af7w5v5m6e/",
"@id": "https://linkedevents.api.test.hel.ninja/v1/event/tet:af7w5v5m6e/",
"@context": "http://schema.org",
"@type": "Event/LinkedEvent"
}
Expand All @@ -167,11 +167,11 @@
{
"id": "tet:test-user-email-set",
"location": {
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/place/tprek:20780/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/place/tprek:20780/"
},
"keywords": [
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:2/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/tet:2/"
}
],
"registration": null,
Expand Down Expand Up @@ -203,7 +203,7 @@
"videos": [],
"in_language": [
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/language/fi/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/language/fi/"
}
],
"audience": [],
Expand Down Expand Up @@ -252,7 +252,7 @@
"short_description": {
"fi": "xx"
},
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/event/tet:af7w4jmjla/",
"@id": "https://linkedevents.api.test.hel.ninja/v1/event/tet:af7w4jmjla/",
"@context": "http://schema.org",
"@type": "Event/LinkedEvent"
}
Expand All @@ -265,35 +265,35 @@
{
"id": "tet:test-user-oid-set",
"location": {
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/place/tprek:56379/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/place/tprek:56379/"
},
"keywords": [
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:12/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/tet:12/"
},
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:1/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/tet:1/"
},
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/yso:p16557/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/yso:p16557/"
},
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/yso:p9903/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/yso:p9903/"
},
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/yso:p13310/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/yso:p13310/"
},
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:6/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/tet:6/"
},
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:4/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/tet:4/"
},
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:10/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/tet:10/"
},
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:9/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/tet:9/"
}
],
"registration": null,
Expand Down Expand Up @@ -325,7 +325,7 @@
"videos": [],
"in_language": [
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/language/fi/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/language/fi/"
}
],
"audience": [],
Expand Down Expand Up @@ -374,7 +374,7 @@
"short_description": {
"fi": "täällä pääset maalaamaan"
},
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/event/tet:af7wtenvii/",
"@id": "https://linkedevents.api.test.hel.ninja/v1/event/tet:af7wtenvii/",
"@context": "http://schema.org",
"@type": "Event/LinkedEvent"
}
Expand All @@ -391,11 +391,11 @@
{
"id": "tet:other-user",
"location": {
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/place/tprek:8740/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/place/tprek:8740/"
},
"keywords": [
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:1/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/tet:1/"
}
],
"registration": null,
Expand Down Expand Up @@ -427,7 +427,7 @@
"videos": [],
"in_language": [
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/language/fi/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/language/fi/"
}
],
"audience": [],
Expand Down Expand Up @@ -476,7 +476,7 @@
"short_description": {
"fi": "kuvaus"
},
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/event/tet:af7wto6nze/",
"@id": "https://linkedevents.api.test.hel.ninja/v1/event/tet:af7wto6nze/",
"@context": "http://schema.org",
"@type": "Event/LinkedEvent"
}
Expand All @@ -489,11 +489,11 @@
{
"id": "tet:companyuser",
"location": {
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/place/tprek:352/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/place/tprek:352/"
},
"keywords": [
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:1/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/tet:1/"
}
],
"registration": null,
Expand Down Expand Up @@ -525,7 +525,7 @@
"videos": [],
"in_language": [
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/language/fi/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/language/fi/"
}
],
"audience": [],
Expand Down Expand Up @@ -571,7 +571,7 @@
"short_description": {
"fi": "x"
},
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/event/tet:af7scpy2de/",
"@id": "https://linkedevents.api.test.hel.ninja/v1/event/tet:af7scpy2de/",
"@context": "http://schema.org",
"@type": "Event/LinkedEvent"
}
Expand All @@ -589,11 +589,11 @@
{
"id": "tet:no-custom-data",
"location": {
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/place/tprek:37497/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/place/tprek:37497/"
},
"keywords": [
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:1/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/keyword/tet:1/"
}
],
"registration": null,
Expand Down Expand Up @@ -625,7 +625,7 @@
"videos": [],
"in_language": [
{
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/language/fi/"
"@id": "https://linkedevents.api.test.hel.ninja/v1/language/fi/"
}
],
"audience": [],
Expand Down Expand Up @@ -665,7 +665,7 @@
"short_description": {
"fi": "kuvaus"
},
"@id": "https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/event/tet:af7wjlxpyy/",
"@id": "https://linkedevents.api.test.hel.ninja/v1/event/tet:af7wjlxpyy/",
"@context": "http://schema.org",
"@type": "Event/LinkedEvent"
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/tet/admin/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ 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: ['linkedevents.api.test.hel.ninja'] } });
12 changes: 6 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 @@ -52,7 +52,7 @@ export const expectToGetEventssErrorFromBackend = (errorCode: 400 | 404 | 500):
};

export const expectPlacesFromLinkedEvents = (): nock.Scope =>
nock('https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1')
nock('https://linkedevents.api.test.hel.ninja/v1')
.get('/place/?show_all_places=true&nocache=true&text=')
.reply(
200,
Expand All @@ -64,7 +64,7 @@ export const expectPlacesFromLinkedEvents = (): nock.Scope =>
);

export const expectKeyWordsFromLinkedEvents = (): nock.Scope =>
nock('https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1')
nock('https://linkedevents.api.test.hel.ninja/v1')
.get('/keyword')
.reply(
200,
Expand All @@ -80,14 +80,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('https://linkedevents.api.test.hel.ninja/v1')
.get('/keyword_set/tet:wm/?include=keywords')
.reply(
200,
{
keywords: [
{
'@id': 'https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:4/',
'@id': 'https://linkedevents.api.test.hel.ninja/v1/keyword/tet:4/',
name: {
fi: 'Tee oikeita töitä',
},
Expand All @@ -100,14 +100,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('https://linkedevents.api.test.hel.ninja/v1')
.get('/keyword_set/tet:attr/?include=keywords')
.reply(
200,
{
keywords: [
{
'@id': 'https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:1/',
'@id': 'https://linkedevents.api.test.hel.ninja/v1/keyword/tet:1/',
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.test.hel.ninja/v1',
timeout: 4000,
headers: {
'Content-Type': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion frontend/tet/youth/browser-tests/search.testcafe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ test('user can search and navigate', async (t) => {
const end = faker.date.soon(100, start);
const startDate = formatDate(start);
const endDate = formatDate(end);
// Should find working method https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/keyword/tet:2/
// Should find working method https://linkedevents.api.test.hel.ninja/v1/keyword/tet:2/
const workMethodText = 'Varjostus';
const languageText = 'Suomi';
const searchTerm = faker.lorem.word();
Expand Down
2 changes: 1 addition & 1 deletion frontend/tet/youth/src/backend-api/backend-api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Axios, { AxiosInstance, AxiosResponse } from 'axios';

export const linkedEventsUrl =
process.env.NEXT_PUBLIC_LINKEDEVENTS_URL || 'https://linkedevents-api.dev.hel.ninja/linkedevents-dev/v1/';
process.env.NEXT_PUBLIC_LINKEDEVENTS_URL || 'https://linkedevents.api.test.hel.ninja/v1/';

export const BackendEndpoint = {
EVENT: 'event/?include=location,keywords&sort=-name',
Expand Down

0 comments on commit 0633b1a

Please sign in to comment.