@swan-io/shared-business 18.5.0 → 18.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/components/BirthdatePicker.d.ts +3 -1
- package/src/components/BirthdatePicker.js +2 -2
- package/src/components/FraudReport/CardDetailsStep.d.ts +7 -0
- package/src/components/FraudReport/CardDetailsStep.js +46 -0
- package/src/components/FraudReport/FraudsterDetailsStep.d.ts +7 -0
- package/src/components/FraudReport/FraudsterDetailsStep.js +56 -0
- package/src/components/FraudReport/IntroStep.js +5 -1
- package/src/components/FraudReport/TransactionPicker.d.ts +13 -0
- package/src/components/FraudReport/TransactionPicker.js +213 -0
- package/src/components/FraudReport/TransactionPickerFilters.d.ts +8 -0
- package/src/components/FraudReport/TransactionPickerFilters.js +213 -0
- package/src/components/FraudReport/TransactionRows.d.ts +8 -0
- package/src/components/FraudReport/TransactionRows.js +32 -0
- package/src/components/FraudReport/TransactionsStep.js +9 -27
- package/src/components/FraudReport/VictimStep.d.ts +3 -1
- package/src/components/FraudReport/VictimStep.js +38 -5
- package/src/components/LakeModal.js +1 -1
- package/src/hooks/__tests__/useFraudReportFlow.test.js +108 -20
- package/src/hooks/useFraudReportFlow.js +12 -7
- package/src/locales/de.json +62 -8
- package/src/locales/en.json +55 -1
- package/src/locales/es.json +55 -1
- package/src/locales/fi.json +55 -1
- package/src/locales/fr.json +55 -1
- package/src/locales/it.json +55 -1
- package/src/locales/nl.json +55 -1
- package/src/locales/pt.json +55 -1
- package/src/utils/__tests__/fraudReport.card.test.d.ts +1 -0
- package/src/utils/__tests__/fraudReport.card.test.js +39 -0
- package/src/utils/__tests__/fraudReport.fraudster.test.d.ts +1 -0
- package/src/utils/__tests__/fraudReport.fraudster.test.js +35 -0
- package/src/utils/__tests__/fraudReport.messages.test.d.ts +1 -0
- package/src/utils/__tests__/fraudReport.messages.test.js +28 -0
- package/src/utils/__tests__/fraudReport.picker.test.d.ts +1 -0
- package/src/utils/__tests__/fraudReport.picker.test.js +171 -0
- package/src/utils/__tests__/fraudReport.pickerFilters.test.d.ts +1 -0
- package/src/utils/__tests__/fraudReport.pickerFilters.test.js +144 -0
- package/src/utils/__tests__/fraudReport.prefill.test.js +3 -1
- package/src/utils/__tests__/fraudReport.rejections.test.js +11 -19
- package/src/utils/__tests__/fraudReport.resume.test.js +17 -3
- package/src/utils/__tests__/fraudReport.toInput.test.js +84 -30
- package/src/utils/__tests__/fraudReport.transactions.test.js +11 -1
- package/src/utils/__tests__/fraudReport.victim.test.js +27 -1
- package/src/utils/__tests__/validation.test.js +69 -2
- package/src/utils/fraudReport/card.d.ts +11 -0
- package/src/utils/fraudReport/card.js +15 -0
- package/src/utils/fraudReport/fakeApi.js +1 -1
- package/src/utils/fraudReport/fraudster.d.ts +10 -0
- package/src/utils/fraudReport/fraudster.js +11 -0
- package/src/utils/fraudReport/messages.d.ts +4 -0
- package/src/utils/fraudReport/messages.js +7 -0
- package/src/utils/fraudReport/picker.d.ts +18 -0
- package/src/utils/fraudReport/picker.js +49 -0
- package/src/utils/fraudReport/pickerFilters.d.ts +26 -0
- package/src/utils/fraudReport/pickerFilters.js +62 -0
- package/src/utils/fraudReport/prefill.js +5 -3
- package/src/utils/fraudReport/rejections.d.ts +0 -1
- package/src/utils/fraudReport/rejections.js +2 -6
- package/src/utils/fraudReport/resume.js +3 -3
- package/src/utils/fraudReport/toInput.d.ts +5 -3
- package/src/utils/fraudReport/toInput.js +20 -22
- package/src/utils/fraudReport/transactions.d.ts +2 -0
- package/src/utils/fraudReport/transactions.js +4 -0
- package/src/utils/fraudReport/validation.d.ts +1 -1
- package/src/utils/fraudReport/validation.js +4 -0
- package/src/utils/fraudReport/victim.d.ts +11 -0
- package/src/utils/fraudReport/victim.js +9 -0
- package/src/utils/validation.d.ts +2 -0
- package/src/utils/validation.js +14 -7
package/src/locales/it.json
CHANGED
|
@@ -147,7 +147,36 @@
|
|
|
147
147
|
"forecastYearlyIncome.from1000001To5000000": "Tra €1.000.000 e €5.000.000",
|
|
148
148
|
"forecastYearlyIncome.from500001To1000000": "Tra €500.000 e €1.000.000",
|
|
149
149
|
"forecastYearlyIncome.moreThan5000000": "Più di €5.000.000",
|
|
150
|
+
"fraudReport.card.action.merchant": "Esercente",
|
|
151
|
+
"fraudReport.card.action.police": "Polizia",
|
|
152
|
+
"fraudReport.card.actionsLabel": "Selezioni tutte le opzioni pertinenti",
|
|
153
|
+
"fraudReport.card.actionsPlaceholder": "Seleziona",
|
|
154
|
+
"fraudReport.card.actionsTitle": "Selezioni chi ha informato della frode",
|
|
155
|
+
"fraudReport.card.blockCards": "Se non l'ha già fatto, blocchi subito le sue carte.",
|
|
156
|
+
"fraudReport.card.lostOrStolenLabel": "Una delle sue carte è stata smarrita o rubata?",
|
|
157
|
+
"fraudReport.card.noticedAtInFuture": "Inserisca la data di oggi o una data precedente.",
|
|
158
|
+
"fraudReport.card.noticedAtInvalid": "Inserisca una data valida.",
|
|
159
|
+
"fraudReport.card.noticedAtLabel": "Quando si è accorto per la prima volta che mancava una carta?",
|
|
160
|
+
"fraudReport.card.title": "Confermi lo stato delle sue carte",
|
|
150
161
|
"fraudReport.continue": "Continua",
|
|
162
|
+
"fraudReport.fraudster.channel.Application": "App, messaggistica o social network",
|
|
163
|
+
"fraudReport.fraudster.channel.Email": "Email",
|
|
164
|
+
"fraudReport.fraudster.channel.Other": "Altro",
|
|
165
|
+
"fraudReport.fraudster.channel.Phone": "Telefonata",
|
|
166
|
+
"fraudReport.fraudster.channel.Sms": "SMS",
|
|
167
|
+
"fraudReport.fraudster.channel.Website": "Sito web",
|
|
168
|
+
"fraudReport.fraudster.channelLabel": "Come l'hanno contattato?",
|
|
169
|
+
"fraudReport.fraudster.description": "Ci dica ciò che può. Non inserisca mai qui una password, un PIN o un codice di sicurezza.",
|
|
170
|
+
"fraudReport.fraudster.shared.BankDetails": "Coordinate bancarie, come un IBAN",
|
|
171
|
+
"fraudReport.fraudster.shared.CardDetails": "Dati della carta (numero, data di scadenza o CVC)",
|
|
172
|
+
"fraudReport.fraudster.shared.Other": "Altro",
|
|
173
|
+
"fraudReport.fraudster.shared.PartnerPassword": "Password dell'app o del sito web",
|
|
174
|
+
"fraudReport.fraudster.shared.PersonalInformation": "Dati di identità (nome, data di nascita, indirizzo o documento d'identità)",
|
|
175
|
+
"fraudReport.fraudster.shared.SwanPasscode": "Codice per confermare i pagamenti",
|
|
176
|
+
"fraudReport.fraudster.shared.VerificationCode": "Codice di verifica monouso",
|
|
177
|
+
"fraudReport.fraudster.sharedItemsLabel": "Cosa ha condiviso?",
|
|
178
|
+
"fraudReport.fraudster.sharedLabel": "Ha condiviso dati bancari o l'accesso al suo conto?",
|
|
179
|
+
"fraudReport.fraudster.title": "Ci dica come è stato contattato e cosa ha condiviso",
|
|
151
180
|
"fraudReport.incident.description": "Ci racconti quello che ricorda. Se non è sicuro di un dettaglio, lo dica.",
|
|
152
181
|
"fraudReport.incident.noticedAtInFuture": "Inserisca la data di oggi o una data precedente.",
|
|
153
182
|
"fraudReport.incident.noticedAtInvalid": "Inserisca una data valida.",
|
|
@@ -175,10 +204,28 @@
|
|
|
175
204
|
"fraudReport.intro.rule.policeReport": "Una <bold>denuncia alla polizia</bold> supporta la sua richiesta. La carichi in questo modulo.",
|
|
176
205
|
"fraudReport.intro.rule.refund": "Solo le transazioni delle ultime <bold>8 settimane</bold> possono essere rimborsate.",
|
|
177
206
|
"fraudReport.intro.rule.saved": "Il modulo viene <bold>salvato automaticamente</bold>, può completarlo in seguito.",
|
|
178
|
-
"fraudReport.intro.rule.transactions": "Segnali fino a <bold>
|
|
207
|
+
"fraudReport.intro.rule.transactions": "Segnali fino a <bold>{max} transazioni</bold> alla volta.",
|
|
179
208
|
"fraudReport.intro.rulesTitle": "Prima di iniziare:",
|
|
180
209
|
"fraudReport.intro.start": "Inizia",
|
|
181
210
|
"fraudReport.intro.title": "Segnala una frode",
|
|
211
|
+
"fraudReport.picker.clearSearch": "Cancella la ricerca",
|
|
212
|
+
"fraudReport.picker.confirm": "Conferma selezione",
|
|
213
|
+
"fraudReport.picker.description": "Selezioni fino a {max} transazioni per questa segnalazione.",
|
|
214
|
+
"fraudReport.picker.emptyTitle": "Nessuna transazione da segnalare",
|
|
215
|
+
"fraudReport.picker.filters.apply": "Applica",
|
|
216
|
+
"fraudReport.picker.filters.clear": "Rimuovi il filtro: {filter}",
|
|
217
|
+
"fraudReport.picker.filters.endDate": "Data di fine",
|
|
218
|
+
"fraudReport.picker.filters.invalidAmount": "Inserisca un importo valido.",
|
|
219
|
+
"fraudReport.picker.filters.startAfterEnd": "La data di inizio non può essere successiva alla data di fine.",
|
|
220
|
+
"fraudReport.picker.filters.startDate": "Data di inizio",
|
|
221
|
+
"fraudReport.picker.limitExceeded": "Può segnalare fino a {max} transazioni alla volta. Ne rimuova {count} per continuare.",
|
|
222
|
+
"fraudReport.picker.loadMore": "Carica altre transazioni",
|
|
223
|
+
"fraudReport.picker.noMatchTitle": "Nessuna transazione corrisponde a questi filtri",
|
|
224
|
+
"fraudReport.picker.noneYetTitle": "Nessuna transazione trovata per ora",
|
|
225
|
+
"fraudReport.picker.search": "Cerca",
|
|
226
|
+
"fraudReport.picker.selectAll": "Seleziona tutte le transazioni",
|
|
227
|
+
"fraudReport.picker.selectTransaction": "Seleziona {counterparty}, {amount}, {date}",
|
|
228
|
+
"fraudReport.picker.title": "Seleziona transazioni",
|
|
182
229
|
"fraudReport.step.confirmation": "Conferma",
|
|
183
230
|
"fraudReport.step.details": "Dettagli",
|
|
184
231
|
"fraudReport.step.documents": "Documenti",
|
|
@@ -190,6 +237,7 @@
|
|
|
190
237
|
"fraudReport.transactions.description": "Selezioni le transazioni collegate alla frode che sta segnalando.",
|
|
191
238
|
"fraudReport.transactions.emptySubtitle": "Selezioni almeno una transazione per continuare.",
|
|
192
239
|
"fraudReport.transactions.emptyTitle": "Nessuna transazione",
|
|
240
|
+
"fraudReport.transactions.limit": "Può segnalare fino a {max} transazioni alla volta.",
|
|
193
241
|
"fraudReport.transactions.listTitle": "Transazioni",
|
|
194
242
|
"fraudReport.transactions.paidTo": "Pagato a",
|
|
195
243
|
"fraudReport.transactions.paymentMethod": "Metodo di pagamento",
|
|
@@ -204,11 +252,16 @@
|
|
|
204
252
|
"fraudReport.transactions.title": "Selezioni le transazioni da segnalare",
|
|
205
253
|
"fraudReport.transactions.total": "Importo totale: <highlight>{amount}</highlight>",
|
|
206
254
|
"fraudReport.transactions.transactionId": "ID transazione",
|
|
255
|
+
"fraudReport.victim.changeConfirm": "Cambia vittima",
|
|
256
|
+
"fraudReport.victim.changeMessage": "Le transazioni con carta che ha selezionato appartengono alla vittima precedente e verranno rimosse da questa segnalazione. I bonifici restano selezionati.",
|
|
257
|
+
"fraudReport.victim.changeMessageCardsOnly": "Le transazioni con carta che ha selezionato appartengono alla vittima precedente e verranno rimosse da questa segnalazione.",
|
|
258
|
+
"fraudReport.victim.changeTitle": "Cambiare vittima?",
|
|
207
259
|
"fraudReport.victim.description": "Scelga la vittima dei pagamenti fraudolenti. Può segnalare solo una vittima alla volta.",
|
|
208
260
|
"fraudReport.victim.forYourself": "Sta segnalando una frode a proprio nome?",
|
|
209
261
|
"fraudReport.victim.memberHelp": "Solo un membro che possa gestire le adesioni al conto può fare una segnalazione per conto di un'altra persona.",
|
|
210
262
|
"fraudReport.victim.memberLabel": "Per chi sta facendo la segnalazione?",
|
|
211
263
|
"fraudReport.victim.reportingFor": "Sta facendo la segnalazione per: <highlight>{name}</highlight>",
|
|
264
|
+
"fraudReport.victim.searchMember": "Cerca un membro",
|
|
212
265
|
"fraudReport.victim.title": "Identità della vittima",
|
|
213
266
|
"monthlyPaymentVolume.between10000And50000": "Tra €10.000 e €50.000 al mese",
|
|
214
267
|
"monthlyPaymentVolume.between50000And100000": "Tra €50.000 e €100.000 al mese",
|
|
@@ -446,6 +499,7 @@
|
|
|
446
499
|
"transactionStatement.type.SepaInstantCreditTransferIn": "Bonifico istantaneo SEPA ricevuto",
|
|
447
500
|
"transactionStatement.type.SepaInstantCreditTransferOut": "Bonifico istantaneo SEPA inviato",
|
|
448
501
|
"validation.birthdateCannotBeFuture": "La data di nascita non può essere nel futuro",
|
|
502
|
+
"validation.birthdateMustBeAdult": "L'età minima è di 18 anni",
|
|
449
503
|
"validation.invalidBirthDate": "Inserisci una data di nascita valida.",
|
|
450
504
|
"validation.invalidDate": "Inserire una data valida."
|
|
451
505
|
}
|
package/src/locales/nl.json
CHANGED
|
@@ -147,7 +147,36 @@
|
|
|
147
147
|
"forecastYearlyIncome.from1000001To5000000": "Tussen € 1.000.000,- en € 5.000.000,-",
|
|
148
148
|
"forecastYearlyIncome.from500001To1000000": "Tussen € 500.000,- en € 1.000.000,-",
|
|
149
149
|
"forecastYearlyIncome.moreThan5000000": "Meer dan 5.000.000,-",
|
|
150
|
+
"fraudReport.card.action.merchant": "Verkoper",
|
|
151
|
+
"fraudReport.card.action.police": "Politie",
|
|
152
|
+
"fraudReport.card.actionsLabel": "Selecteer alles wat van toepassing is",
|
|
153
|
+
"fraudReport.card.actionsPlaceholder": "Selecteren",
|
|
154
|
+
"fraudReport.card.actionsTitle": "Selecteer wie je over de fraude hebt geïnformeerd",
|
|
155
|
+
"fraudReport.card.blockCards": "Blokkeer je kaarten nu als je dat nog niet hebt gedaan.",
|
|
156
|
+
"fraudReport.card.lostOrStolenLabel": "Is een van je kaarten verloren of gestolen?",
|
|
157
|
+
"fraudReport.card.noticedAtInFuture": "Vul de datum van vandaag of een eerdere datum in.",
|
|
158
|
+
"fraudReport.card.noticedAtInvalid": "Vul een geldige datum in.",
|
|
159
|
+
"fraudReport.card.noticedAtLabel": "Wanneer merkte je voor het eerst dat een kaart ontbrak?",
|
|
160
|
+
"fraudReport.card.title": "Bevestig de status van je kaarten",
|
|
150
161
|
"fraudReport.continue": "Doorgaan",
|
|
162
|
+
"fraudReport.fraudster.channel.Application": "App, chatdienst of sociaal netwerk",
|
|
163
|
+
"fraudReport.fraudster.channel.Email": "E-mail",
|
|
164
|
+
"fraudReport.fraudster.channel.Other": "Overig",
|
|
165
|
+
"fraudReport.fraudster.channel.Phone": "Telefoongesprek",
|
|
166
|
+
"fraudReport.fraudster.channel.Sms": "Sms",
|
|
167
|
+
"fraudReport.fraudster.channel.Website": "Website",
|
|
168
|
+
"fraudReport.fraudster.channelLabel": "Hoe namen ze contact met je op?",
|
|
169
|
+
"fraudReport.fraudster.description": "Vertel ons wat je kunt. Vul hier nooit een wachtwoord, pincode of beveiligingscode in.",
|
|
170
|
+
"fraudReport.fraudster.shared.BankDetails": "Bankgegevens, zoals een IBAN",
|
|
171
|
+
"fraudReport.fraudster.shared.CardDetails": "Kaartgegevens (nummer, vervaldatum of CVC)",
|
|
172
|
+
"fraudReport.fraudster.shared.Other": "Overig",
|
|
173
|
+
"fraudReport.fraudster.shared.PartnerPassword": "Wachtwoord van de app of website",
|
|
174
|
+
"fraudReport.fraudster.shared.PersonalInformation": "Identiteitsgegevens (naam, geboortedatum, adres of identiteitsbewijs)",
|
|
175
|
+
"fraudReport.fraudster.shared.SwanPasscode": "Toegangscode om betalingen te bevestigen",
|
|
176
|
+
"fraudReport.fraudster.shared.VerificationCode": "Eenmalige verificatiecode",
|
|
177
|
+
"fraudReport.fraudster.sharedItemsLabel": "Wat heb je gedeeld?",
|
|
178
|
+
"fraudReport.fraudster.sharedLabel": "Heb je bankgegevens of toegang tot je rekening gedeeld?",
|
|
179
|
+
"fraudReport.fraudster.title": "Vertel ons hoe er contact met je is opgenomen en wat je hebt gedeeld",
|
|
151
180
|
"fraudReport.incident.description": "Vertel ons wat je je herinnert. Twijfel je over een detail? Zeg dat dan.",
|
|
152
181
|
"fraudReport.incident.noticedAtInFuture": "Vul de datum van vandaag of een eerdere datum in.",
|
|
153
182
|
"fraudReport.incident.noticedAtInvalid": "Vul een geldige datum in.",
|
|
@@ -175,10 +204,28 @@
|
|
|
175
204
|
"fraudReport.intro.rule.policeReport": "Een <bold>proces-verbaal van aangifte</bold> ondersteunt je claim. Upload het in dit formulier.",
|
|
176
205
|
"fraudReport.intro.rule.refund": "Alleen transacties van de afgelopen <bold>8 weken</bold> komen in aanmerking voor terugbetaling.",
|
|
177
206
|
"fraudReport.intro.rule.saved": "Het formulier wordt <bold>automatisch opgeslagen</bold>, je kunt het later afmaken.",
|
|
178
|
-
"fraudReport.intro.rule.transactions": "Meld tot <bold>
|
|
207
|
+
"fraudReport.intro.rule.transactions": "Meld tot <bold>{max} transacties</bold> tegelijk.",
|
|
179
208
|
"fraudReport.intro.rulesTitle": "Voordat je begint:",
|
|
180
209
|
"fraudReport.intro.start": "Starten",
|
|
181
210
|
"fraudReport.intro.title": "Fraude melden",
|
|
211
|
+
"fraudReport.picker.clearSearch": "Zoekopdracht wissen",
|
|
212
|
+
"fraudReport.picker.confirm": "Selectie bevestigen",
|
|
213
|
+
"fraudReport.picker.description": "Selecteer maximaal {max} transacties voor deze melding.",
|
|
214
|
+
"fraudReport.picker.emptyTitle": "Geen transacties om te melden",
|
|
215
|
+
"fraudReport.picker.filters.apply": "Toepassen",
|
|
216
|
+
"fraudReport.picker.filters.clear": "Filter wissen: {filter}",
|
|
217
|
+
"fraudReport.picker.filters.endDate": "Einddatum",
|
|
218
|
+
"fraudReport.picker.filters.invalidAmount": "Vul een geldig bedrag in.",
|
|
219
|
+
"fraudReport.picker.filters.startAfterEnd": "De begindatum mag niet na de einddatum liggen.",
|
|
220
|
+
"fraudReport.picker.filters.startDate": "Begindatum",
|
|
221
|
+
"fraudReport.picker.limitExceeded": "Je kunt maximaal {max} transacties tegelijk melden. Verwijder er {count} om door te gaan.",
|
|
222
|
+
"fraudReport.picker.loadMore": "Meer transacties laden",
|
|
223
|
+
"fraudReport.picker.noMatchTitle": "Geen transacties komen overeen met deze filters",
|
|
224
|
+
"fraudReport.picker.noneYetTitle": "Nog geen transacties gevonden",
|
|
225
|
+
"fraudReport.picker.search": "Zoeken",
|
|
226
|
+
"fraudReport.picker.selectAll": "Alle transacties selecteren",
|
|
227
|
+
"fraudReport.picker.selectTransaction": "{counterparty}, {amount}, {date} selecteren",
|
|
228
|
+
"fraudReport.picker.title": "Transacties selecteren",
|
|
182
229
|
"fraudReport.step.confirmation": "Bevestiging",
|
|
183
230
|
"fraudReport.step.details": "Details",
|
|
184
231
|
"fraudReport.step.documents": "Documenten",
|
|
@@ -190,6 +237,7 @@
|
|
|
190
237
|
"fraudReport.transactions.description": "Selecteer de transacties die horen bij de fraude die je meldt.",
|
|
191
238
|
"fraudReport.transactions.emptySubtitle": "Selecteer minstens één transactie om verder te gaan.",
|
|
192
239
|
"fraudReport.transactions.emptyTitle": "Geen transacties",
|
|
240
|
+
"fraudReport.transactions.limit": "Je kunt maximaal {max} transacties tegelijk melden.",
|
|
193
241
|
"fraudReport.transactions.listTitle": "Transacties",
|
|
194
242
|
"fraudReport.transactions.paidTo": "Betaald aan",
|
|
195
243
|
"fraudReport.transactions.paymentMethod": "Betaalmethode",
|
|
@@ -204,11 +252,16 @@
|
|
|
204
252
|
"fraudReport.transactions.title": "Selecteer de transacties die je wilt melden",
|
|
205
253
|
"fraudReport.transactions.total": "Totaalbedrag: <highlight>{amount}</highlight>",
|
|
206
254
|
"fraudReport.transactions.transactionId": "Transactie-ID",
|
|
255
|
+
"fraudReport.victim.changeConfirm": "Slachtoffer wijzigen",
|
|
256
|
+
"fraudReport.victim.changeMessage": "De kaarttransacties die je hebt geselecteerd horen bij het vorige slachtoffer en worden uit deze melding verwijderd. Overschrijvingen blijven geselecteerd.",
|
|
257
|
+
"fraudReport.victim.changeMessageCardsOnly": "De kaarttransacties die je hebt geselecteerd horen bij het vorige slachtoffer en worden uit deze melding verwijderd.",
|
|
258
|
+
"fraudReport.victim.changeTitle": "Slachtoffer wijzigen?",
|
|
207
259
|
"fraudReport.victim.description": "Kies het slachtoffer van de frauduleuze betalingen. Je kunt maar één slachtoffer tegelijk melden.",
|
|
208
260
|
"fraudReport.victim.forYourself": "Meld je fraude voor jezelf?",
|
|
209
261
|
"fraudReport.victim.memberHelp": "Alleen een lid dat de lidmaatschappen kan beheren, kan een melding doen namens iemand anders.",
|
|
210
262
|
"fraudReport.victim.memberLabel": "Voor wie doe je de melding?",
|
|
211
263
|
"fraudReport.victim.reportingFor": "Je doet de melding voor: <highlight>{name}</highlight>",
|
|
264
|
+
"fraudReport.victim.searchMember": "Zoeken naar een lid",
|
|
212
265
|
"fraudReport.victim.title": "Identiteit van het slachtoffer",
|
|
213
266
|
"monthlyPaymentVolume.between10000And50000": "Tussen de € 10.000,- en € 50.000,- per maand",
|
|
214
267
|
"monthlyPaymentVolume.between50000And100000": "Tussen € 50.000,- en € 100.000,- per maand",
|
|
@@ -446,6 +499,7 @@
|
|
|
446
499
|
"transactionStatement.type.SepaInstantCreditTransferIn": "SEPA Instant-overschrijving ontvangen",
|
|
447
500
|
"transactionStatement.type.SepaInstantCreditTransferOut": "SEPA Instant-overschrijving verzonden",
|
|
448
501
|
"validation.birthdateCannotBeFuture": "Geboortedatum kan niet in de toekomst liggen",
|
|
502
|
+
"validation.birthdateMustBeAdult": "Moet minimaal 18 jaar oud zijn",
|
|
449
503
|
"validation.invalidBirthDate": "Voer een geldige geboortedatum in.",
|
|
450
504
|
"validation.invalidDate": "Voer een geldige datum in."
|
|
451
505
|
}
|
package/src/locales/pt.json
CHANGED
|
@@ -147,7 +147,36 @@
|
|
|
147
147
|
"forecastYearlyIncome.from1000001To5000000": "Entre 1.000.000 € e 5.000.000 €",
|
|
148
148
|
"forecastYearlyIncome.from500001To1000000": "Entre 500.000 € e 1.000.000 €",
|
|
149
149
|
"forecastYearlyIncome.moreThan5000000": "Mais de 5.000.000 €",
|
|
150
|
+
"fraudReport.card.action.merchant": "Comerciante",
|
|
151
|
+
"fraudReport.card.action.police": "Polícia",
|
|
152
|
+
"fraudReport.card.actionsLabel": "Selecione todas as opções aplicáveis",
|
|
153
|
+
"fraudReport.card.actionsPlaceholder": "Selecionar",
|
|
154
|
+
"fraudReport.card.actionsTitle": "Selecione a quem comunicou a fraude",
|
|
155
|
+
"fraudReport.card.blockCards": "Se ainda não o fez, bloqueie já os seus cartões.",
|
|
156
|
+
"fraudReport.card.lostOrStolenLabel": "Algum dos seus cartões foi perdido ou roubado?",
|
|
157
|
+
"fraudReport.card.noticedAtInFuture": "Introduza a data de hoje ou uma data anterior.",
|
|
158
|
+
"fraudReport.card.noticedAtInvalid": "Introduza uma data válida.",
|
|
159
|
+
"fraudReport.card.noticedAtLabel": "Quando reparou pela primeira vez que faltava um cartão?",
|
|
160
|
+
"fraudReport.card.title": "Confirme o estado dos seus cartões",
|
|
150
161
|
"fraudReport.continue": "Continuar",
|
|
162
|
+
"fraudReport.fraudster.channel.Application": "Aplicação, mensagens ou rede social",
|
|
163
|
+
"fraudReport.fraudster.channel.Email": "E-mail",
|
|
164
|
+
"fraudReport.fraudster.channel.Other": "Outro",
|
|
165
|
+
"fraudReport.fraudster.channel.Phone": "Chamada telefónica",
|
|
166
|
+
"fraudReport.fraudster.channel.Sms": "SMS",
|
|
167
|
+
"fraudReport.fraudster.channel.Website": "Site",
|
|
168
|
+
"fraudReport.fraudster.channelLabel": "Como o contactaram?",
|
|
169
|
+
"fraudReport.fraudster.description": "Diga-nos o que puder. Nunca escreva aqui uma palavra-passe, um PIN ou um código de segurança.",
|
|
170
|
+
"fraudReport.fraudster.shared.BankDetails": "Dados bancários, como um IBAN",
|
|
171
|
+
"fraudReport.fraudster.shared.CardDetails": "Dados do cartão (número, data de validade ou CVC)",
|
|
172
|
+
"fraudReport.fraudster.shared.Other": "Outro",
|
|
173
|
+
"fraudReport.fraudster.shared.PartnerPassword": "Palavra-passe da aplicação ou do site",
|
|
174
|
+
"fraudReport.fraudster.shared.PersonalInformation": "Dados de identidade (nome, data de nascimento, morada ou documento de identificação)",
|
|
175
|
+
"fraudReport.fraudster.shared.SwanPasscode": "Código usado para confirmar pagamentos",
|
|
176
|
+
"fraudReport.fraudster.shared.VerificationCode": "Código de verificação de utilização única",
|
|
177
|
+
"fraudReport.fraudster.sharedItemsLabel": "O que partilhou?",
|
|
178
|
+
"fraudReport.fraudster.sharedLabel": "Partilhou dados bancários ou o acesso à sua conta?",
|
|
179
|
+
"fraudReport.fraudster.title": "Indique-nos como foi contactado e o que partilhou",
|
|
151
180
|
"fraudReport.incident.description": "Conte-nos aquilo de que se lembra. Se não tiver a certeza de algum detalhe, indique-o.",
|
|
152
181
|
"fraudReport.incident.noticedAtInFuture": "Introduza a data de hoje ou uma data anterior.",
|
|
153
182
|
"fraudReport.incident.noticedAtInvalid": "Introduza uma data válida.",
|
|
@@ -175,10 +204,28 @@
|
|
|
175
204
|
"fraudReport.intro.rule.policeReport": "Uma <bold>queixa à polícia</bold> fundamenta o seu pedido. Carregue-a neste formulário.",
|
|
176
205
|
"fraudReport.intro.rule.refund": "Só as transações das últimas <bold>8 semanas</bold> podem ser reembolsadas.",
|
|
177
206
|
"fraudReport.intro.rule.saved": "O formulário é <bold>guardado automaticamente</bold>, pode terminá-lo mais tarde.",
|
|
178
|
-
"fraudReport.intro.rule.transactions": "Comunique até <bold>
|
|
207
|
+
"fraudReport.intro.rule.transactions": "Comunique até <bold>{max} transações</bold> de cada vez.",
|
|
179
208
|
"fraudReport.intro.rulesTitle": "Antes de começar:",
|
|
180
209
|
"fraudReport.intro.start": "Começar",
|
|
181
210
|
"fraudReport.intro.title": "Comunicar uma fraude",
|
|
211
|
+
"fraudReport.picker.clearSearch": "Limpar a pesquisa",
|
|
212
|
+
"fraudReport.picker.confirm": "Confirmar seleção",
|
|
213
|
+
"fraudReport.picker.description": "Selecione até {max} transações para esta comunicação.",
|
|
214
|
+
"fraudReport.picker.emptyTitle": "Nenhuma transação a comunicar",
|
|
215
|
+
"fraudReport.picker.filters.apply": "Aplicar",
|
|
216
|
+
"fraudReport.picker.filters.clear": "Remover o filtro: {filter}",
|
|
217
|
+
"fraudReport.picker.filters.endDate": "Data de fim",
|
|
218
|
+
"fraudReport.picker.filters.invalidAmount": "Introduza um montante válido.",
|
|
219
|
+
"fraudReport.picker.filters.startAfterEnd": "A data de início não pode ser posterior à data de fim.",
|
|
220
|
+
"fraudReport.picker.filters.startDate": "Data de início",
|
|
221
|
+
"fraudReport.picker.limitExceeded": "Pode comunicar até {max} transações de cada vez. Remova {count} para continuar.",
|
|
222
|
+
"fraudReport.picker.loadMore": "Carregar mais transações",
|
|
223
|
+
"fraudReport.picker.noMatchTitle": "Nenhuma transação corresponde a estes filtros",
|
|
224
|
+
"fraudReport.picker.noneYetTitle": "Ainda não foi encontrada nenhuma transação",
|
|
225
|
+
"fraudReport.picker.search": "Pesquisar",
|
|
226
|
+
"fraudReport.picker.selectAll": "Selecionar todas as transações",
|
|
227
|
+
"fraudReport.picker.selectTransaction": "Selecionar {counterparty}, {amount}, {date}",
|
|
228
|
+
"fraudReport.picker.title": "Selecionar transações",
|
|
182
229
|
"fraudReport.step.confirmation": "Confirmação",
|
|
183
230
|
"fraudReport.step.details": "Detalhes",
|
|
184
231
|
"fraudReport.step.documents": "Documentos",
|
|
@@ -190,6 +237,7 @@
|
|
|
190
237
|
"fraudReport.transactions.description": "Selecione as transações relacionadas com a fraude que está a comunicar.",
|
|
191
238
|
"fraudReport.transactions.emptySubtitle": "Selecione pelo menos uma transação para continuar.",
|
|
192
239
|
"fraudReport.transactions.emptyTitle": "Nenhuma transação",
|
|
240
|
+
"fraudReport.transactions.limit": "Pode comunicar até {max} transações de cada vez.",
|
|
193
241
|
"fraudReport.transactions.listTitle": "Transações",
|
|
194
242
|
"fraudReport.transactions.paidTo": "Pago a",
|
|
195
243
|
"fraudReport.transactions.paymentMethod": "Método de pagamento",
|
|
@@ -204,11 +252,16 @@
|
|
|
204
252
|
"fraudReport.transactions.title": "Selecione as transações a comunicar",
|
|
205
253
|
"fraudReport.transactions.total": "Montante total: <highlight>{amount}</highlight>",
|
|
206
254
|
"fraudReport.transactions.transactionId": "ID da transação",
|
|
255
|
+
"fraudReport.victim.changeConfirm": "Mudar de vítima",
|
|
256
|
+
"fraudReport.victim.changeMessage": "As transações com cartão que selecionou pertencem à vítima anterior e serão removidas desta comunicação. As transferências continuam selecionadas.",
|
|
257
|
+
"fraudReport.victim.changeMessageCardsOnly": "As transações com cartão que selecionou pertencem à vítima anterior e serão removidas desta comunicação.",
|
|
258
|
+
"fraudReport.victim.changeTitle": "Mudar de vítima?",
|
|
207
259
|
"fraudReport.victim.description": "Escolha a vítima dos pagamentos fraudulentos. Só pode comunicar a fraude de uma vítima de cada vez.",
|
|
208
260
|
"fraudReport.victim.forYourself": "Está a comunicar uma fraude em nome próprio?",
|
|
209
261
|
"fraudReport.victim.memberHelp": "Só um membro que possa gerir as associações da conta pode fazer uma comunicação em nome de outra pessoa.",
|
|
210
262
|
"fraudReport.victim.memberLabel": "Em nome de quem está a fazer a comunicação?",
|
|
211
263
|
"fraudReport.victim.reportingFor": "Está a fazer a comunicação em nome de: <highlight>{name}</highlight>",
|
|
264
|
+
"fraudReport.victim.searchMember": "Pesquisar um membro",
|
|
212
265
|
"fraudReport.victim.title": "Identidade da vítima",
|
|
213
266
|
"monthlyPaymentVolume.between10000And50000": "Entre 10.000€ e 50.000€ por mês",
|
|
214
267
|
"monthlyPaymentVolume.between50000And100000": "Entre 50.000€ e 100.000€ por mês",
|
|
@@ -446,6 +499,7 @@
|
|
|
446
499
|
"transactionStatement.type.SepaInstantCreditTransferIn": "Transferência de crédito instantânea SEPA recebida",
|
|
447
500
|
"transactionStatement.type.SepaInstantCreditTransferOut": "Transferência de crédito instantânea SEPA enviada",
|
|
448
501
|
"validation.birthdateCannotBeFuture": "A data de nascimento não pode estar no futuro",
|
|
502
|
+
"validation.birthdateMustBeAdult": "Deve ter pelo menos 18 anos",
|
|
449
503
|
"validation.invalidBirthDate": "Por favor, introduza uma data de nascimento válida.",
|
|
450
504
|
"validation.invalidDate": "Por favor, introduza uma data válida."
|
|
451
505
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
import { getCardActions, toCardValues } from "../fraudReport/card";
|
|
3
|
+
describe("getCardActions", () => {
|
|
4
|
+
test("selects the actions answered yes", () => {
|
|
5
|
+
expect(getCardActions({ hasContactedMerchant: true, hasFiledPoliceComplaint: true })).toEqual([
|
|
6
|
+
"Merchant",
|
|
7
|
+
"Police",
|
|
8
|
+
]);
|
|
9
|
+
});
|
|
10
|
+
test("selects nothing for actions answered no or not answered", () => {
|
|
11
|
+
expect(getCardActions({ hasContactedMerchant: false, hasFiledPoliceComplaint: undefined })).toEqual([]);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
describe("toCardValues", () => {
|
|
15
|
+
test("sends the noticed date and the selected actions when the card was lost or stolen", () => {
|
|
16
|
+
expect(toCardValues({
|
|
17
|
+
isLostOrStolen: true,
|
|
18
|
+
lostOrStolenNoticedAt: "2026-10-21",
|
|
19
|
+
actions: ["Merchant", "Police"],
|
|
20
|
+
})).toEqual({
|
|
21
|
+
isLostOrStolen: true,
|
|
22
|
+
lostOrStolenNoticedAt: "2026-10-21",
|
|
23
|
+
hasContactedMerchant: true,
|
|
24
|
+
hasFiledPoliceComplaint: true,
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
test.each([false, undefined])("clears the noticed date when lost or stolen is %s", isLostOrStolen => {
|
|
28
|
+
expect(toCardValues({ isLostOrStolen, lostOrStolenNoticedAt: "2026-10-21", actions: [] })
|
|
29
|
+
.lostOrStolenNoticedAt).toBeUndefined();
|
|
30
|
+
});
|
|
31
|
+
test("leaves an unselected action empty instead of sending false", () => {
|
|
32
|
+
expect(toCardValues({ isLostOrStolen: undefined, lostOrStolenNoticedAt: undefined, actions: [] })).toEqual({
|
|
33
|
+
isLostOrStolen: undefined,
|
|
34
|
+
lostOrStolenNoticedAt: undefined,
|
|
35
|
+
hasContactedMerchant: undefined,
|
|
36
|
+
hasFiledPoliceComplaint: undefined,
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
import { getSharedInformationChoice, toSharedInformation } from "../fraudReport/fraudster";
|
|
3
|
+
describe("getSharedInformationChoice", () => {
|
|
4
|
+
test.each([undefined, []])("leaves the question unanswered for %j", shared => {
|
|
5
|
+
expect(getSharedInformationChoice(shared)).toEqual({ answer: undefined, items: [] });
|
|
6
|
+
});
|
|
7
|
+
test("answers No when nothing was shared", () => {
|
|
8
|
+
expect(getSharedInformationChoice(["None"])).toEqual({ answer: "No", items: [] });
|
|
9
|
+
expect(getSharedInformationChoice(["None", "CardDetails"])).toEqual({
|
|
10
|
+
answer: "No",
|
|
11
|
+
items: [],
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
test("answers Yes with what was shared", () => {
|
|
15
|
+
expect(getSharedInformationChoice(["VerificationCode", "CardDetails"])).toEqual({
|
|
16
|
+
answer: "Yes",
|
|
17
|
+
items: ["VerificationCode", "CardDetails"],
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
describe("toSharedInformation", () => {
|
|
22
|
+
test("sends None for No, even with items picked before", () => {
|
|
23
|
+
expect(toSharedInformation({ answer: "No", items: ["CardDetails"] })).toEqual(["None"]);
|
|
24
|
+
});
|
|
25
|
+
test("sends what was shared for Yes", () => {
|
|
26
|
+
expect(toSharedInformation({ answer: "Yes", items: ["SwanPasscode", "BankDetails"] })).toEqual([
|
|
27
|
+
"SwanPasscode",
|
|
28
|
+
"BankDetails",
|
|
29
|
+
]);
|
|
30
|
+
});
|
|
31
|
+
test("leaves the answer empty for Yes with nothing picked, or no answer", () => {
|
|
32
|
+
expect(toSharedInformation({ answer: "Yes", items: [] })).toBeUndefined();
|
|
33
|
+
expect(toSharedInformation({ answer: undefined, items: ["CardDetails"] })).toBeUndefined();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { expect, test } from "vitest";
|
|
2
|
+
import en from "../../locales/en.json";
|
|
3
|
+
import { getTransactionsLimitMessage } from "../fraudReport/messages";
|
|
4
|
+
import { MAX_TRANSACTIONS } from "../fraudReport/transactions";
|
|
5
|
+
test("gives the limit of a report", () => {
|
|
6
|
+
expect(getTransactionsLimitMessage()).toBe(`You can report up to ${MAX_TRANSACTIONS} transactions at a time.`);
|
|
7
|
+
});
|
|
8
|
+
test("gives the limit the API rejection carries", () => {
|
|
9
|
+
expect(getTransactionsLimitMessage({ max: 50 })).toBe("You can report up to 50 transactions at a time.");
|
|
10
|
+
});
|
|
11
|
+
test("says how many transactions to remove", () => {
|
|
12
|
+
expect(getTransactionsLimitMessage({ toRemove: 2 })).toBe(`You can report up to ${MAX_TRANSACTIONS} transactions at a time. Remove 2 to continue.`);
|
|
13
|
+
});
|
|
14
|
+
test("says how many to remove with the limit the API rejection carries", () => {
|
|
15
|
+
expect(getTransactionsLimitMessage({ max: 50, toRemove: 2 })).toBe("You can report up to 50 transactions at a time. Remove 2 to continue.");
|
|
16
|
+
});
|
|
17
|
+
test("asks to remove nothing when nothing is over the limit", () => {
|
|
18
|
+
expect(getTransactionsLimitMessage({ toRemove: 0 })).toBe(getTransactionsLimitMessage());
|
|
19
|
+
});
|
|
20
|
+
test.each([
|
|
21
|
+
"fraudReport.transactions.limit",
|
|
22
|
+
"fraudReport.picker.limitExceeded",
|
|
23
|
+
"fraudReport.picker.description",
|
|
24
|
+
"fraudReport.intro.rule.transactions",
|
|
25
|
+
])("%s takes the limit as an argument", key => {
|
|
26
|
+
expect(en[key]).toContain("{max}");
|
|
27
|
+
expect(en[key]).not.toContain(String(MAX_TRANSACTIONS));
|
|
28
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
import { createFakeTransaction } from "../fraudReport/fakeApi";
|
|
3
|
+
import { countPagesWithoutRows, getPickerTransactions, getSelectAllValue, restartPickerPages, toggleAllTransactions, toggleTransaction, } from "../fraudReport/picker";
|
|
4
|
+
const victimCard = createFakeTransaction("card-victim", "CardOutDebit");
|
|
5
|
+
const otherCard = createFakeTransaction("card-other", "CardOutDebit");
|
|
6
|
+
const sepa = createFakeTransaction("transfer-sepa", "SepaCreditTransferOut");
|
|
7
|
+
const instant = createFakeTransaction("transfer-instant", "SepaInstantCreditTransferOut");
|
|
8
|
+
const international = createFakeTransaction("transfer-international", "InternationalCreditTransferOut");
|
|
9
|
+
const internal = createFakeTransaction("transfer-internal", "InternalCreditTransferOut");
|
|
10
|
+
const rows = [
|
|
11
|
+
{ transaction: victimCard, cardAccountMembershipId: "member-victim" },
|
|
12
|
+
{ transaction: otherCard, cardAccountMembershipId: "member-other" },
|
|
13
|
+
{ transaction: sepa, cardAccountMembershipId: null },
|
|
14
|
+
{ transaction: instant, cardAccountMembershipId: null },
|
|
15
|
+
{ transaction: international, cardAccountMembershipId: null },
|
|
16
|
+
{ transaction: internal, cardAccountMembershipId: null },
|
|
17
|
+
];
|
|
18
|
+
describe("getPickerTransactions", () => {
|
|
19
|
+
test("lists a card transaction only when its card belongs to the victim", () => {
|
|
20
|
+
const listed = getPickerTransactions(rows, "member-victim");
|
|
21
|
+
expect(listed).toContain(victimCard);
|
|
22
|
+
expect(listed).not.toContain(otherCard);
|
|
23
|
+
});
|
|
24
|
+
test("lists every transfer, whoever the victim is", () => {
|
|
25
|
+
expect(getPickerTransactions(rows, "member-other")).toEqual([
|
|
26
|
+
otherCard,
|
|
27
|
+
sepa,
|
|
28
|
+
instant,
|
|
29
|
+
international,
|
|
30
|
+
internal,
|
|
31
|
+
]);
|
|
32
|
+
});
|
|
33
|
+
test("lists no card transaction while the victim isn't known", () => {
|
|
34
|
+
expect(getPickerTransactions(rows, undefined)).toEqual([
|
|
35
|
+
sepa,
|
|
36
|
+
instant,
|
|
37
|
+
international,
|
|
38
|
+
internal,
|
|
39
|
+
]);
|
|
40
|
+
});
|
|
41
|
+
test("leaves out a card transaction whose card has no known account membership", () => {
|
|
42
|
+
expect(getPickerTransactions([{ transaction: victimCard, cardAccountMembershipId: null }], "member-victim")).toEqual([]);
|
|
43
|
+
});
|
|
44
|
+
test("keeps the order of the rows and removes duplicates", () => {
|
|
45
|
+
expect(getPickerTransactions([
|
|
46
|
+
{ transaction: sepa, cardAccountMembershipId: null },
|
|
47
|
+
{ transaction: victimCard, cardAccountMembershipId: "member-victim" },
|
|
48
|
+
{ transaction: sepa, cardAccountMembershipId: null },
|
|
49
|
+
], "member-victim")).toEqual([sepa, victimCard]);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
describe("toggleTransaction", () => {
|
|
53
|
+
test("adds a transaction that isn't selected, after the others", () => {
|
|
54
|
+
expect(toggleTransaction([sepa], victimCard)).toEqual([sepa, victimCard]);
|
|
55
|
+
});
|
|
56
|
+
test("removes a selected transaction, matched by ID", () => {
|
|
57
|
+
expect(toggleTransaction([sepa, victimCard], { ...sepa, counterparty: "Renamed" })).toEqual([
|
|
58
|
+
victimCard,
|
|
59
|
+
]);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
describe("getSelectAllValue", () => {
|
|
63
|
+
test("is false when no listed transaction is selected", () => {
|
|
64
|
+
expect(getSelectAllValue([otherCard], [sepa, instant])).toBe(false);
|
|
65
|
+
});
|
|
66
|
+
test("is mixed when some listed transactions are selected", () => {
|
|
67
|
+
expect(getSelectAllValue([sepa], [sepa, instant])).toBe("mixed");
|
|
68
|
+
});
|
|
69
|
+
test("is true when every listed transaction is selected", () => {
|
|
70
|
+
expect(getSelectAllValue([instant, sepa, otherCard], [sepa, instant])).toBe(true);
|
|
71
|
+
});
|
|
72
|
+
test("is false when nothing is listed", () => {
|
|
73
|
+
expect(getSelectAllValue([sepa], [])).toBe(false);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
describe("toggleAllTransactions", () => {
|
|
77
|
+
test("selects the listed transactions that aren't selected yet", () => {
|
|
78
|
+
expect(toggleAllTransactions([instant], [sepa, instant, internal])).toEqual([
|
|
79
|
+
instant,
|
|
80
|
+
sepa,
|
|
81
|
+
internal,
|
|
82
|
+
]);
|
|
83
|
+
});
|
|
84
|
+
test("unselects the listed transactions when all of them are selected", () => {
|
|
85
|
+
expect(toggleAllTransactions([sepa, instant], [sepa, instant])).toEqual([]);
|
|
86
|
+
});
|
|
87
|
+
test("keeps a selected transaction that isn't listed, both ways", () => {
|
|
88
|
+
expect(toggleAllTransactions([otherCard], [sepa])).toEqual([otherCard, sepa]);
|
|
89
|
+
expect(toggleAllTransactions([otherCard, sepa], [sepa])).toEqual([otherCard]);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
describe("countPagesWithoutRows", () => {
|
|
93
|
+
const start = { rowCount: 20, listedCount: 4, withoutRows: 0, restarted: false };
|
|
94
|
+
test("counts a page that adds no listed row", () => {
|
|
95
|
+
expect(countPagesWithoutRows(start, 40, 4)).toEqual({
|
|
96
|
+
rowCount: 40,
|
|
97
|
+
listedCount: 4,
|
|
98
|
+
withoutRows: 1,
|
|
99
|
+
restarted: false,
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
test("keeps counting over pages in a row", () => {
|
|
103
|
+
const second = countPagesWithoutRows(countPagesWithoutRows(start, 40, 4), 60, 4);
|
|
104
|
+
expect(second.withoutRows).toBe(2);
|
|
105
|
+
});
|
|
106
|
+
test("starts again from zero when a page adds a listed row", () => {
|
|
107
|
+
const empty = countPagesWithoutRows(start, 40, 4);
|
|
108
|
+
expect(countPagesWithoutRows(empty, 60, 5)).toEqual({
|
|
109
|
+
rowCount: 60,
|
|
110
|
+
listedCount: 5,
|
|
111
|
+
withoutRows: 0,
|
|
112
|
+
restarted: false,
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
test("doesn't count a render with no new page", () => {
|
|
116
|
+
const empty = countPagesWithoutRows(start, 40, 4);
|
|
117
|
+
expect(countPagesWithoutRows(empty, 40, 4)).toBe(empty);
|
|
118
|
+
});
|
|
119
|
+
test("doesn't count the rows being cleared", () => {
|
|
120
|
+
const paused = { ...start, withoutRows: 3 };
|
|
121
|
+
expect(countPagesWithoutRows(paused, 0, 0)).toEqual({
|
|
122
|
+
rowCount: 0,
|
|
123
|
+
listedCount: 0,
|
|
124
|
+
withoutRows: 0,
|
|
125
|
+
restarted: false,
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
test("starts again when fewer rows come back: it is another list", () => {
|
|
129
|
+
const long = { rowCount: 60, listedCount: 10, withoutRows: 2, restarted: false };
|
|
130
|
+
expect(countPagesWithoutRows(long, 20, 3).withoutRows).toBe(0);
|
|
131
|
+
expect(countPagesWithoutRows(long, 20, 0).withoutRows).toBe(1);
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
describe("restartPickerPages", () => {
|
|
135
|
+
const paused = { rowCount: 20, listedCount: 10, withoutRows: 3, restarted: false };
|
|
136
|
+
test("ends the pause right away", () => {
|
|
137
|
+
expect(restartPickerPages(paused).withoutRows).toBe(0);
|
|
138
|
+
});
|
|
139
|
+
test("makes the next rows a first page, even when they are more than before", () => {
|
|
140
|
+
const restarted = restartPickerPages(paused);
|
|
141
|
+
expect(countPagesWithoutRows(restarted, 40, 3)).toEqual({
|
|
142
|
+
rowCount: 40,
|
|
143
|
+
listedCount: 3,
|
|
144
|
+
withoutRows: 0,
|
|
145
|
+
restarted: false,
|
|
146
|
+
});
|
|
147
|
+
expect(countPagesWithoutRows(restarted, 40, 0).withoutRows).toBe(1);
|
|
148
|
+
});
|
|
149
|
+
test("waits for the rows to change", () => {
|
|
150
|
+
const restarted = restartPickerPages(paused);
|
|
151
|
+
expect(countPagesWithoutRows(restarted, 20, 10)).toBe(restarted);
|
|
152
|
+
});
|
|
153
|
+
test("counts a first page with as many rows as before, once the load ended", () => {
|
|
154
|
+
const restarted = restartPickerPages(paused);
|
|
155
|
+
expect(countPagesWithoutRows(restarted, 20, 0, true)).toEqual({
|
|
156
|
+
rowCount: 20,
|
|
157
|
+
listedCount: 0,
|
|
158
|
+
withoutRows: 1,
|
|
159
|
+
restarted: false,
|
|
160
|
+
});
|
|
161
|
+
expect(countPagesWithoutRows(restarted, 20, 4, true).withoutRows).toBe(0);
|
|
162
|
+
});
|
|
163
|
+
test("the end of a load counts no page when the list wasn't replaced", () => {
|
|
164
|
+
expect(countPagesWithoutRows(paused, 20, 10, true)).toBe(paused);
|
|
165
|
+
});
|
|
166
|
+
test("counts the pages after the first one as usual", () => {
|
|
167
|
+
const first = countPagesWithoutRows(restartPickerPages(paused), 40, 3);
|
|
168
|
+
expect(countPagesWithoutRows(first, 60, 3).withoutRows).toBe(1);
|
|
169
|
+
expect(countPagesWithoutRows(first, 60, 4).withoutRows).toBe(0);
|
|
170
|
+
});
|
|
171
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|