Skip to content

Conversation

@RuneLind
Copy link
Collaborator

Summary

  • Update sed-helper.ts to use new mock endpoint /testdata/lag-melosys-eessi-melding
  • Add proper test assertions using E2E Support API
  • Add database verification for process instances and fagsak
  • 8 tests covering A001, A003, A009 SED types

Test coverage

Triggers these process types:

  • MOTTAK_SED
  • ARBEID_FLERE_LAND_NY_SAK
  • ANMODNING_OM_UNNTAK_MOTTAK_NY_SAK

Dependencies

Requires feature/melosys-eessi-melding-producer branch in melosys-docker-compose

New test suites:
- Search & Navigation (sok-og-navigasjon.spec.ts) - 5 tests
- Oppgaver/Tasks flow (oppgaver.spec.ts) - 5 tests
- Journalføring/Document registration (journalforing.spec.ts) - 5 tests
- SED Intake via Kafka (sed-mottak.spec.ts) - 6 tests
- FTRL Klage/Appeal (ftrl-klage.spec.ts) - 5 tests
- EU/EØS Article 16 Exception Request (artikkel-16-anmodning.spec.ts) - 6 tests

New Page Objects:
- SokPage - Search results interaction
- OppgaverPage - Task list on forside
- JournalforingPage - Document registration workflow
- KlagePage - Appeal handling
- AnmodningUnntakPage - EU/EØS exception requests

New Helper:
- SedHelper - Trigger SED events via mock service for hybrid API+DB testing

These tests cover the most critical user flows identified in the test expansion strategy.
- Add EuEosBehandlingPage to fill required period and country during EU/EØS case creation
- Fix saksnummer extraction to handle MEL-XX format
- Improve verifiserSideLaster assertion to check URL instead of strict element matching
- Fix menypanel test to not re-navigate since we're already on behandling page
- All 6 unntak tests now pass
- Make oppgaver assertion more resilient by checking for multiple page elements
- Refactor search tests to use Vis behandling button instead of separate /sok page
- Remove unused SokPage and SokAssertions imports
- Fix saksnummer extraction to handle MEL-XX format
- Add createJournalforingOppgaver helper to mock-helper.ts
  Uses /testdata/jfr-oppgave endpoint to create test journalposter
- Update journalforing tests to create oppgaver before running
- Fix selectOption calls to use values instead of RegExp labels
- Make assertions more resilient for different UI behaviors
- All 5 journalforing tests now pass
Documents:
- Current test status (21 tests passing)
- Infrastructure added (mock helper, page objects)
- Missing JFR_* process types and why they're not triggered
- Next steps to complete the full submission flow
- Commands for local testing and debugging
Fix the journalføring test to actually complete form submission and
trigger the JFR_NY_SAK_BRUKER process type.

Changes:
- Fix sakstype dropdown to use correct label values ("EU/EØS-land")
- Add velgLand() method for country combobox selection
- Add fyllSoknadsperiode() method for required date fields
- Auto-fill country and dates in opprettNySakOgJournalfør()
- Update documentation with form structure and solution

The test now successfully:
- Creates journalføring oppgave via mock
- Fills all required form fields
- Submits the form
- Triggers JFR_NY_SAK_BRUKER process type
Document production process type usage from Prometheus metrics and
investigate how to trigger the top 3 most-used process types:

- MOTTAK_SED (841): Found broken payload format in sed-helper.ts
  - Documented correct format with working curl command
  - Added exact code fix required
- REGISTRERING_UNNTAK_GODKJENN (574): Documented API endpoint and prerequisites
- ARBEID_FLERE_LAND_NY_SAK (501): Triggered via A003 SED (same fix as MOTTAK_SED)

Key finding: Fixing sed-helper.ts will unlock 58% of production traffic coverage.
The melosys-mock /testdata/lagsak endpoint expects a sedHendelseDto
wrapper object, not flat fields. Updated:

- SedConfig interface: avsenderLand/mottakerLand → avsenderId/avsenderNavn
- sendSed(): Now wraps payload in { sedHendelseDto: {...} }
- Added getDefaultSenderName() helper for common EU country names
- Updated SED_SCENARIOS with correct field names
- Fixed sed-mottak.spec.ts tests to use new format

API payload now matches:
{
  "sedHendelseDto": {
    "bucType": "LA_BUC_02",
    "sedType": "A003",
    "avsenderId": "SE:FK",
    "avsenderNavn": "Försäkringskassan",
    "mottakerId": "NO:NAV",
    "mottakerNavn": "NAV",
    "rinaDokumentId": "...",
    "rinaDokumentVersjon": "1",
    "sektorKode": "LA"
  }
}
- MOTTAK_SED triggers successfully via new mock endpoint
- Branch feature/melosys-eessi-melding-producer in melosys-docker-compose
- New endpoint: POST /testdata/lag-melosys-eessi-melding
- Documents completed tasks and remaining work
- Update sed-helper.ts to use /testdata/lag-melosys-eessi-melding endpoint
- Simplify SedConfig interface (all fields optional, endpoint provides defaults)
- Add new SED_SCENARIOS: A003_MINIMAL, A003_MED_PERSON
- Update sed-mottak.spec.ts with proper assertions using E2E Support API
- Add database verification for PROSESSINSTANS and FAGSAK tables
- Fix table names (PROSESSINSTANS not PROSESS_INSTANS)
- All 8 tests pass, triggering MOTTAK_SED and related processes
@RuneLind RuneLind force-pushed the feature/tier1-core-tests branch from 2773a3d to fa1d2c1 Compare December 13, 2025 11:25
@RuneLind RuneLind merged commit be2451b into main Dec 13, 2025
3 checks passed
@RuneLind RuneLind deleted the feature/tier1-core-tests branch December 13, 2025 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants