Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vaihdettu "valintalaskentakerralla"-pyynnöt menemään valintalaskenta--servicen kautta #54

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/lib/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const configuration = {
ataruEditoriLogin: `${DOMAIN}/lomake-editori/auth/cas`,
valintalaskentaServiceLogin: `${DOMAIN}/valintalaskenta-laskenta-service/auth/login`,
valintalaskentaKoostePalveluUrl: `${DOMAIN}/valintalaskentakoostepalvelu/resources/`,
valintalaskentaServiceUrl: `${DOMAIN}/valintalaskenta-laskenta-service/resources/`,
koostetutPistetiedot: ({
hakuOid,
hakukohdeOid,
Expand Down
6 changes: 3 additions & 3 deletions src/app/lib/valintalaskentakoostepalvelu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const kaynnistaLaskenta = async (
): Promise<LaskentaStart> => {
const laskentaUrl = formSearchParamsForStartLaskenta({
laskentaUrl: new URL(
`${configuration.valintalaskentaKoostePalveluUrl}valintalaskentakerralla/haku/${haku.oid}/tyyppi/HAKUKOHDE/whitelist/true?`,
`${configuration.valintalaskentaServiceUrl}valintalaskentakerralla/haku/${haku.oid}/tyyppi/HAKUKOHDE/whitelist/true?`,
),
haku,
hakukohde,
Expand All @@ -114,7 +114,7 @@ export const kaynnistaLaskentaHakukohteenValinnanvaiheille = async (
): Promise<LaskentaStart> => {
const laskentaUrl = formSearchParamsForStartLaskenta({
laskentaUrl: new URL(
`${configuration.valintalaskentaKoostePalveluUrl}valintalaskentakerralla/haku/${haku.oid}/tyyppi/HAKUKOHDE/whitelist/true?`,
`${configuration.valintalaskentaServiceUrl}valintalaskentakerralla/haku/${haku.oid}/tyyppi/HAKUKOHDE/whitelist/true?`,
),
haku,
hakukohde,
Expand All @@ -140,7 +140,7 @@ export const getLaskennanTilaHakukohteelle = async (
ilmoitukset: [{ otsikko: string; tyyppi: string }] | null;
}>;
}>(
`${configuration.valintalaskentaKoostePalveluUrl}valintalaskentakerralla/status/${loadingUrl}/yhteenveto`,
`${configuration.valintalaskentaServiceUrl}valintalaskentakerralla/status/${loadingUrl}/yhteenveto`,
);
return response.data?.hakukohteet
?.filter((hk) => hk.ilmoitukset?.some((i) => i.tyyppi === 'VIRHE'))
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/valinnan-hallinta.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test('displays valinnanvaiheet', async ({ page }) => {

test('starts laskenta', async ({ page }) => {
await page.route(
'*/**/valintalaskentakoostepalvelu/resources/valintalaskentakerralla/haku/1.2.246.562.29.00000000000000045102/tyyppi/HAKUKOHDE/whitelist/true**',
'*/**/resources/valintalaskentakerralla/haku/1.2.246.562.29.00000000000000045102/tyyppi/HAKUKOHDE/whitelist/true**',
async (route) => {
const started = {
lisatiedot: {
Expand Down Expand Up @@ -70,7 +70,7 @@ test('starts laskenta', async ({ page }) => {

test('shows success toast when laskenta completes', async ({ page }) => {
await page.route(
'*/**/valintalaskentakoostepalvelu/resources/valintalaskentakerralla/haku/1.2.246.562.29.00000000000000045102/tyyppi/HAKUKOHDE/whitelist/true**',
'*/**/resources/valintalaskentakerralla/haku/1.2.246.562.29.00000000000000045102/tyyppi/HAKUKOHDE/whitelist/true**',
async (route) => {
const started = {
lisatiedot: {
Expand Down Expand Up @@ -98,7 +98,7 @@ test('shows success toast when laskenta completes', async ({ page }) => {
},
);
await page.route(
'*/**/valintalaskentakoostepalvelu/resources/valintalaskentakerralla/status/12345abs/yhteenveto',
'*/**/resources/valintalaskentakerralla/status/12345abs/yhteenveto',
async (route) => {
await route.fulfill({
json: {
Expand All @@ -124,7 +124,7 @@ test('shows success toast when laskenta completes', async ({ page }) => {

test('starting laskenta causes error', async ({ page }) => {
await page.route(
'*/**/valintalaskentakoostepalvelu/resources/valintalaskentakerralla/haku/1.2.246.562.29.00000000000000045102/tyyppi/HAKUKOHDE/whitelist/true**',
'*/**/resources/valintalaskentakerralla/haku/1.2.246.562.29.00000000000000045102/tyyppi/HAKUKOHDE/whitelist/true**',
async (route) => {
await route.fulfill({ status: 500, body: 'Unknown error' });
},
Expand Down