Skip to content

Commit

Permalink
fix: broken tests and audit (#2374)
Browse files Browse the repository at this point in the history
* fix: sync translations

* fix: type in tests

* fix: add @babel/traverse to allowlist

* fix: handler browser tests
  • Loading branch information
mjturt committed Oct 23, 2023
1 parent d9f8d7d commit 62bbebc
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 14 deletions.
7 changes: 4 additions & 3 deletions frontend/audit-ci.jsonc
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"high": true,
"allowlist": [
"json5", // jest, eslint, testcafe, next, babel
"json5", // jest, eslint, testcafe, next, babel
"parse-url", // lerna
"parse-path", // lerna
"shell-quote", // next
"loader-utils", // next
"moment", // testcafe
"jsonwebtoken", // testcafe
"jsonwebtoken", // testcafe
"http-cache-semantics", // testcafe
"requestretry", // slack-node
"decode-uri-component" // testcafe, lerna
"decode-uri-component", // testcafe, lerna
"@babel/traverse" // jest
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import sv from '../../public/locales/sv/common.json';
import HandlerTranslations from '../../test/i18n/handler-translations';

abstract class HandlerPageComponent extends TranslatedComponent<HandlerTranslations> {
public datatestId;
public datatestId: string;

protected constructor(options?: Options) {
super(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ test('Page has a single application', async () => {
fi.review.headings.heading3,
fi.review.headings.heading4,
fi.review.headings.heading5,
fi.review.headings.heading6,
fi.review.headings.heading7,
fi.review.headings.heading8,
fi.review.headings.heading9,
Expand Down
8 changes: 7 additions & 1 deletion frontend/benefit/handler/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,9 @@
"fullApplication": {
"title": "Alkuperäinen hakemus"
},
"employeeConsent": {
"title": "Suostumus"
},
"otherAttachment": {
"title": "Muu liite"
}
Expand Down Expand Up @@ -664,7 +667,7 @@
"heading6": "Palkkatukipäätös",
"heading7": "Haettu ajanjakso",
"heading8": "Työsuhde",
"heading9": "Suostumus",
"heading9": "Työllistettävän henkilötietojen käsittely",
"heading10": "Hakemuksen käsittely",
"heading11": "Muut liitteet",
"heading12": "Paperihakemuksen tiedot"
Expand Down Expand Up @@ -867,6 +870,9 @@
"fullApplication": {
"title": "Paperihakemus"
},
"employeeConsent": {
"title": "Suostumus"
},
"otherAttachment": {
"title": "Muu liite"
}
Expand Down
8 changes: 7 additions & 1 deletion frontend/benefit/handler/public/locales/sv/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,9 @@
"fullApplication": {
"title": "Alkuperäinen hakemus"
},
"employeeConsent": {
"title": "Suostumus"
},
"otherAttachment": {
"title": "Muu liite"
}
Expand Down Expand Up @@ -664,7 +667,7 @@
"heading6": "Palkkatukipäätös",
"heading7": "Haettu ajanjakso",
"heading8": "Työsuhde",
"heading9": "Suostumus",
"heading9": "Työllistettävän henkilötietojen käsittely",
"heading10": "Hakemuksen käsittely",
"heading11": "Muut liitteet",
"heading12": "Paperihakemuksen tiedot"
Expand Down Expand Up @@ -867,6 +870,9 @@
"fullApplication": {
"title": "Paperihakemus"
},
"employeeConsent": {
"title": "Suostumus"
},
"otherAttachment": {
"title": "Muu liite"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ const DeminimisView: React.FC<ApplicationReviewViewProps> = ({ data }) => {
</$GridCell>
<$GridCell $colSpan={3}>
<$SummaryTableValue>
{formatFloatToCurrency(amount, 'EUR', 'FI-fi', 0)}
{amount
? formatFloatToCurrency(amount, 'EUR', 'FI-fi', 0)
: ''}
</$SummaryTableValue>
</$GridCell>
<$GridCell>
Expand All @@ -72,12 +74,14 @@ const DeminimisView: React.FC<ApplicationReviewViewProps> = ({ data }) => {
</$GridCell>
<$GridCell $colSpan={3}>
<$SummaryTableLastLine>
{formatFloatToCurrency(
data.totalDeminimisAmount,
'EUR',
'FI-fi',
0
)}
{data?.totalDeminimisAmount
? formatFloatToCurrency(
data.totalDeminimisAmount,
'EUR',
'FI-fi',
0
)
: ''}
</$SummaryTableLastLine>
</$GridCell>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('DeminimisView', () => {
deMinimisAidSet: [
{ grantedAt: '01-02-2021', granter: 'test granter', amount: 1000 },
],
totalDeminimisAmount: '1000',
},
};

Expand Down

0 comments on commit 62bbebc

Please sign in to comment.