Skip to content

Commit

Permalink
Adjust unit tests to new type.materialTypeSpecific field
Browse files Browse the repository at this point in the history
  • Loading branch information
spaceo committed Jan 13, 2024
1 parent 3db5081 commit 9e5b89e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/core/utils/helpers/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export const getMaterialTypes = (
manifestations
.map((manifest) =>
manifest.materialTypes.map((type, i) =>
i === 0 ? type.specific : null
i === 0 ? type.materialTypeSpecific.display : null
)
)
.flat()
Expand All @@ -333,7 +333,11 @@ export const getMaterialTypes = (
// In this case we aggreate all types even if a manifestation has multiple types.
return uniq(
manifestations
.map((manifest) => manifest.materialTypes.map((type) => type.specific))
.map((manifest) =>
manifest.materialTypes.map((type) => {
return type.materialTypeSpecific?.display;
})
)
.flat()
) as ManifestationMaterialType[];
};
Expand Down Expand Up @@ -585,10 +589,14 @@ if (import.meta.vitest) {
{
materialTypes: [
{
specific: "artikel"
materialTypeSpecific: {
display: "artikel"
}
},
{
specific: "artikel (online)"
materialTypeSpecific: {
display: "artikel (online)"
}
}
]
}
Expand Down

0 comments on commit 9e5b89e

Please sign in to comment.