Skip to content

Commit

Permalink
endre til visningsVariant
Browse files Browse the repository at this point in the history
  • Loading branch information
SandraLekve committed Nov 12, 2024
1 parent 5d2e17d commit c56dfc7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ object SøknadTilGenereltFormatMapper {
private fun feltlisteMap(
label: String,
verdi: List<*>,
type: VisningsVariant? = null,
visningsVariant: VisningsVariant? = null,
): Map<String, Any> =
if (type == null) {
if (visningsVariant == null) {
mapOf("label" to label, "verdiliste" to verdi)
} else {
mapOf("label" to label, "type" to type.visningsVariantName, "verdiliste" to verdi)
mapOf("label" to label, "visningsVariant" to visningsVariant.visningsVariantName, "verdiliste" to verdi)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class SøknadTilGenereltFormatMapperTest {

val verdiliste = mapSøknadsfelter["verdiliste"] as List<Map<String, Any>>

val harVisningsVariantBarn = verdiliste.any { it["type"] == "Tabell Barn" }
val harVisningsVariantBarn = verdiliste.any { it["visningsVariant"] == "Tabell Barn" }
Assertions.assertThat(harVisningsVariantBarn).isTrue
}

Expand All @@ -49,7 +49,7 @@ class SøknadTilGenereltFormatMapperTest {
val verdiliste = mapSøknadsfelter["verdiliste"] as List<Map<String, Any>>
println(verdiliste)

val harVisningsVariantVedlegg = verdiliste.any { it["type"] == "Vedlegg" }
val harVisningsVariantVedlegg = verdiliste.any { it["visningsVariant"] == "Vedlegg" }
Assertions.assertThat(harVisningsVariantVedlegg).isTrue
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@
},
{
"label": "Vedlegg",
"type" : "Vedlegg",
"visningsVariant" : "Vedlegg",
"verdiliste": [
{
"label": "Vedlegg",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
{
"label": "Dokumenter vedlagt",
"type" : "Vedlegg",
"visningsVariant" : "Vedlegg",
"verdiliste": [
{
"label": "Vedlegg",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
},
{
"label":"Barna dine",
"type":"Tabell Barn",
"visningsVariant":"Tabell Barn",
"verdiliste":[
{
"label":"Barnets fulle navn, hvis dette er bestemt",
Expand Down Expand Up @@ -627,7 +627,7 @@
},
{
"label":"Vedlegg",
"type" : "Vedlegg",
"visningsVariant" : "Vedlegg",
"verdiliste":[
{
"label":"Vedlegg",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@
},
{
"label": "Vedlegg",
"type" : "Vedlegg",
"visningsVariant" : "Vedlegg",
"verdiliste": [
{
"label": "Vedlegg",
Expand Down

0 comments on commit c56dfc7

Please sign in to comment.