Skip to content

Commit

Permalink
Fikset cypress tester etter nytt oppsett for henting av grupper
Browse files Browse the repository at this point in the history
#deploy-test-frontend
  • Loading branch information
stigus committed Oct 11, 2023
1 parent 3773297 commit b4c3ae8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions apps/dolly-frontend/src/main/js/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ const hentGrupper = new RegExp(/api\/v1\/gruppe\?pageNo/)
const histark = new RegExp(/testnav-histark-proxy\/api\//)
const personFragmentSearch = new RegExp(/\/testnav-pdl-forvalter\/api\/v1\/identiteter\?fragment/)
const personFragmentNaviger = new RegExp(/dolly-backend\/api\/v1\/ident\/naviger\/12345678912/)
const hentGruppe = new RegExp(/\/api\/v1\/gruppe\/1/)
const hentGruppeEn = new RegExp(/\/api\/v1\/gruppe\/1/)
const hentGruppeTo = new RegExp(/\/api\/v1\/gruppe\/2/)
const hentGruppeBestilling = new RegExp(/dolly-backend\/api\/v1\/bestilling\/gruppe\/1/)
const pdlPersonBolk = new RegExp(/\/api\/v2\/personer\/identer/)
const pdlPersonEnkelt = new RegExp(/person-service\/api\/v2\/personer\/ident/)
Expand Down Expand Up @@ -102,7 +103,8 @@ beforeEach(() => {
cy.intercept({ method: 'GET', url: personFragmentNaviger }, personFragmentNavigerMock)
cy.intercept({ method: 'GET', url: hentGrupper }, paginerteGrupperMock)
cy.intercept({ method: 'GET', url: histark }, histarkMock)
cy.intercept({ method: 'GET', url: hentGruppe }, eksisterendeGruppeMock)
cy.intercept({ method: 'GET', url: hentGruppeEn }, eksisterendeGruppeMock)
cy.intercept({ method: 'GET', url: hentGruppeTo }, nyGruppeMock)
cy.intercept({ method: 'GET', url: hentGruppeBestilling }, backendBestillingerMock)
cy.intercept({ method: 'POST', url: lagNyGruppe }, { statusCode: 201, body: nyGruppeMock })
cy.intercept({ method: 'GET', url: pdlPersonBolk }, pdlBulkpersonerMock)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { LeggTilPaaGruppe } from '@/pages/gruppe/LeggTilPaaGruppe/LeggTilPaaGrup
import cn from 'classnames'
import Icon from '@/components/ui/icon/Icon'
import { CypressSelector } from '../../../../cypress/mocks/Selectors'
import Loading from '@/components/ui/loading/Loading'

type GruppeHeaderProps = {
gruppeId: string
Expand Down Expand Up @@ -50,8 +51,11 @@ const GruppeHeader = ({
const {
currentBruker: { brukertype },
} = useCurrentBruker()
const { gruppe } = useGruppeById(gruppeId)
const { gruppe, loading } = useGruppeById(gruppeId)

if (loading) {
return <Loading label={'Laster gruppe...'} />
}
const erLaast = gruppe.erLaast

const headerClass = erLaast ? 'gruppe-header-laast' : 'gruppe-header'
Expand Down

0 comments on commit b4c3ae8

Please sign in to comment.