Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into feature/endringsmelding-fronten…
Browse files Browse the repository at this point in the history
…d-refaktor
  • Loading branch information
stigus committed Apr 10, 2024
2 parents 9da9f95 + 1e5a320 commit f6c2954
Show file tree
Hide file tree
Showing 72 changed files with 2,641 additions and 443 deletions.
1 change: 1 addition & 0 deletions apps/dolly-frontend/config.idporten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ spec:
- application: testnav-person-service
- application: generer-navn-service
- application: testnav-kodeverk-service
- application: testnav-tenor-search-service
external:
- host: testnav-pensjon-testdata-facade-proxy.dev-fss-pub.nais.io
- host: testnav-sigrunstub-proxy.dev-fss-pub.nais.io
Expand Down
1 change: 1 addition & 0 deletions apps/dolly-frontend/config.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ spec:
- application: testnav-person-service
- application: generer-navn-service
- application: testnav-kodeverk-service
- application: testnav-tenor-search-service
external:
- host: testnav-pensjon-testdata-facade-proxy.dev-fss-pub.nais.io
- host: testnav-sigrunstub-proxy.dev-fss-pub.nais.io
Expand Down
1 change: 1 addition & 0 deletions apps/dolly-frontend/config.unstable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ spec:
- application: testnav-adresse-service
- application: testnorge-tilbakemelding-api
- application: testnav-kodeverk-service
- application: testnav-tenor-search-service
external:
- host: testnav-pensjon-testdata-facade-proxy.dev-fss-pub.nais.io
- host: testnav-sigrunstub-proxy.dev-fss-pub.nais.io
Expand Down
1 change: 1 addition & 0 deletions apps/dolly-frontend/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ spec:
- application: testnav-adresse-service
- application: testnorge-tilbakemelding-api
- application: testnav-kodeverk-service
- application: testnav-tenor-search-service
external:
- host: testnav-pensjon-testdata-facade-proxy.dev-fss-pub.nais.io
- host: testnav-sigrunstub-proxy.dev-fss-pub.nais.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
.route(createRoute(consumers.getTestnavPersonService(), "person-service"))
.route(createRoute(consumers.getGenererNavnService()))
.route(createRoute(consumers.getTestnavKodeverkService()))
.route(createRoute(consumers.getTestnavTenorSearchService()))
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,6 @@ public class Consumers {
private ServerProperties testnavVarslingerService;
private ServerProperties testnorgeProfilApi;
private ServerProperties testnorgeTilbakemeldingApi;
private ServerProperties testnavTenorSearchService;

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public RouterFunction<ServerResponse> htmlRouter(@Value("classpath:/static/index
.andRoute(RequestPredicates.GET("/login/**"), indexHandler)
.andRoute(RequestPredicates.GET("/bruker/**"), indexHandler)
.andRoute(RequestPredicates.GET("/team/**"), indexHandler)
.andRoute(RequestPredicates.GET("/dollysoek/**"), indexHandler);
.andRoute(RequestPredicates.GET("/dollysoek/**"), indexHandler)
.andRoute(RequestPredicates.GET("/tenor/**"), indexHandler);
}
}
58 changes: 58 additions & 0 deletions apps/dolly-frontend/src/main/js/cypress/e2e/TenorSoek.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { CypressSelector } from '../mocks/Selectors'
import {
responseFalse,
responseTrue,
tenorSoekOversiktMock,
tenorSoekTestdataMock,
} from '../mocks/BasicMocks'

describe('Tenor-søk testing', () => {
const tenorSoekOversikt = new RegExp(
/testnav-tenor-search-service\/api\/v1\/tenor\/testdata\/oversikt\?antall=10&side=0/,
)
const tenorSoekTestdata = new RegExp(
/testnav-tenor-search-service\/api\/v1\/tenor\/testdata\?kilde=FREG&type=AlleFelter/,
)
const dollyBackendFinnesTrue = new RegExp(/dolly-backend\/api\/v1\/ident\/finnes\/12345678912/)
const dollyBackendFinnesFalse = new RegExp(/dolly-backend\/api\/v1\/ident\/finnes\/98765432198/)

it('passes', () => {
cy.visit('')

cy.intercept({ method: 'POST', url: tenorSoekOversikt }, tenorSoekOversiktMock)
cy.intercept({ method: 'POST', url: tenorSoekTestdata }, tenorSoekTestdataMock)
cy.intercept({ method: 'GET', url: dollyBackendFinnesTrue }, responseTrue)
cy.intercept({ method: 'GET', url: dollyBackendFinnesFalse }, responseFalse)

// Naviger til Tenor-soek og gjoer et soek
cy.dollyGet(CypressSelector.BUTTON_HEADER_FINNPERSON).click()
cy.dollyGet(CypressSelector.BUTTON_HEADER_TENOR).click()
cy.get('h1').contains('Søk etter personer i Tenor').should('exist')
cy.dollyGet(CypressSelector.CHECKBOX_TENORSOEK).click()
cy.wait(1000)

// Velg person som ikke ligger i Dolly og start import av personen
cy.get('div').contains('TIGER ULV').click()
cy.get('h2').contains('TIGER ULV').should('exist')
cy.dollyGet(CypressSelector.BUTTON_IMPORTER_PERSONER).click()
cy.wait(500)
cy.get('h1').contains('Importer person').should('exist')
cy.dollyGet(CypressSelector.BUTTON_IMPORTER).click()
cy.wait(500)
cy.get('.bestillingsveileder').should('exist')
cy.dollyGet(CypressSelector.BUTTON_AVBRYT).click()
cy.wait(500)
cy.dollyGet(CypressSelector.BUTTON_BEKREFT).click()
cy.wait(1000)
cy.get('h1').contains('Søk etter personer i Tenor').should('exist')

// Naviger til foerste person som ligger i Dolly
cy.dollyGet(CypressSelector.BUTTON_VIS_I_GRUPPE).first().click()
cy.wait(500)
cy.get('h1').contains('Testytest').should('exist')

// Gaa til soek fra gruppe
cy.dollyGet(CypressSelector.BUTTON_IMPORTER_PERSONER).click()
cy.get('h1').contains('Søk etter personer i Tenor').should('exist')
})
})
6 changes: 0 additions & 6 deletions apps/dolly-frontend/src/main/js/cypress/e2e/Test-Norge.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,5 @@ describe('Test-Norge søk testing', () => {
cy.wait(200)

cy.get('.skjemaelement__feilmelding').should('not.exist')

cy.dollyGet(CypressSelector.BUTTON_HEADER_PERSONER).click()
cy.get('div').contains('Testytest').click()
cy.dollyGet(CypressSelector.BUTTON_IMPORTER_PERSONER).click()

cy.dollyGet(CypressSelector.TITLE_TESTNORGE).should('exist')
})
})
69 changes: 69 additions & 0 deletions apps/dolly-frontend/src/main/js/cypress/mocks/BasicMocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1882,3 +1882,72 @@ export const bestillingFragmentNavigerMock = {
bestillingNavigerTil: 1,
sidetall: 0,
}

export const tenorSoekOversiktMock = {
status: 'OK',
data: {
treff: 2,
rader: 2,
offset: 0,
nesteSide: null,
seed: 1111,
personer: [
{
id: '12345678912',
fornavn: 'TESTYTEST',
etternavn: 'CAFE',
tenorRelasjoner: ['Freg'],
},
{
id: '98765432198',
fornavn: 'TIGER',
etternavn: 'ULV',
tenorRelasjoner: ['Freg'],
},
],
},
query: 'legitimasjonsdokument:*',
error: null,
}

export const tenorSoekTestdataMock = {
status: 'OK',
data: {
treff: 2,
rader: 2,
offset: 0,
nesteSide: null,
seed: 1111,
dokumentListe: [
{
foedselsdato: '1992-06-04',
identifikator: ['12345678912'],
kjoenn: 'kvinne',
personstatus: 'midlertidig',
sivilstand: 'gift',
tenorMetadata: {
kildedata: '{}',
},
visningnavn: 'TESTYTEST CAFE',
},
{
foedselsdato: '1974-02-02',
identifikator: ['98765432198'],
kjoenn: 'kvinne',
personstatus: 'bosatt',
sivilstand: 'ugift',
tenorMetadata: {
kildedata: '{}',
},
visningnavn: 'TIGER ULV',
},
],
fasetter: {},
},
query: '',
error: null,
}

export const responseTrue = { body: true }

export const responseFalse = { body: false }
7 changes: 7 additions & 0 deletions apps/dolly-frontend/src/main/js/cypress/mocks/Selectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export enum CypressSelector {
INPUT_MINSIDE_SOEK_MAL = 'input-minside-mal',
INPUT_DOLLY_SOEK = 'input-dolly-soek',
INPUT_TESTNORGE_FNR = 'input-testnorge-fnr',
INPUT_TENORSOEK_FNR = 'input-tenorsoek-fnr',
INPUT_NAVN = 'input-navn',
INPUT_NY_GRUPPE_NAVN = 'input-ny-gruppe-navn',
INPUT_NY_GRUPPE_HENSIKT = 'input-ny-gruppe-hensikt',
Expand Down Expand Up @@ -44,6 +45,8 @@ export enum CypressSelector {
BUTTON_FJERN_ALLE = 'button-fjern-alle',
BUTTON_VIDERE = 'button-videre',
BUTTON_TILBAKE = 'button-tilbake',
BUTTON_AVBRYT = 'button-avbryt',
BUTTON_BEKREFT = 'button-bekreft',
BUTTON_FLYTT_PERSONER = 'button-flytt-personer',
BUTTON_FLYTT_PERSONER_AVBRYT = 'button-flytt-personer-avbryt',
BUTTON_VARSLING_LUKK = 'button-varsling-lukk',
Expand All @@ -55,13 +58,15 @@ export enum CypressSelector {
BUTTON_HEADER_FINNPERSON = 'button-header-finnperson',
BUTTON_HEADER_DOLLYSOEK = 'button-header-dollysoek',
BUTTON_HEADER_TESTNORGE = 'button-header-testnorge',
BUTTON_HEADER_TENOR = 'button-header-tenor',
BUTTON_HEADER_ENDRINGSMELDING = 'button-header-endringsmelding',
BUTTON_PROFIL = 'button-minside',
BUTTON_PROFIL_MINSIDE = 'button-profil-minside',
BUTTON_SEND_FORBEDRINGSOENSKE = 'button-send-forbedringsoenske',
BUTTON_FULLFOER_BESTILLING = 'button-fullfoer-bestilling',
BUTTON_AVBRYT_BESTILLING = 'button-avbryt-bestilling',
BUTTON_IMPORTER_PERSONER = 'button-importer-personer',
BUTTON_IMPORTER = 'button-importer',
BUTTON_MINSIDE_ENDRE_MALNAVN = 'button-minside-endre-malnavn',
BUTTON_MINSIDE_LAGRE_MALNAVN = 'button-minside-lagre-malnavn',
BUTTON_LUKK_BESTILLING_RESULTAT = 'button-lukk-bestilling-resultat',
Expand All @@ -82,10 +87,12 @@ export enum CypressSelector {
BUTTON_GJENOPPRETT_GRUPPE = 'button-gjenopprett-gruppe',
BUTTON_REDIGER_GRUPPE = 'button-rediger-gruppe',
BUTTON_TIDLIGEREBESTILLINGER_NAVIGER = 'button-tidligerebestillinger-naviger',
BUTTON_PERSON_TENORSOEK = 'button-person-tenorsoek',
SELECT_PERSON_SEARCH = 'select-person-search',
SELECT_TAGS = 'select-tags',
HOVER_MILJOE = 'hover-miljoe',
CHECKBOX_FORBEDRING_ANONYM = 'checkbox-forbedring-anonym',
CHECKBOX_TENORSOEK = 'checkbox-tenorsoek',
ERROR_MESSAGE_NAVIGERING = 'error-message-navigering',
EXPANDABLE_PERSONINFORMASJON = 'expandable-personinformasjon',
CONTAINER_VALGTE_PERSONER = 'container-valgte-personer',
Expand Down
Loading

0 comments on commit f6c2954

Please sign in to comment.