element-portable/test/components/views
Eric Eastwood c1e7905ddc
Properly translate errors in AddThreepid.ts (#10432)
* Properly translate errors in AddThreepid.ts

Part of https://github.com/vector-im/element-web/issues/9597

* Use translated message

* Avoid returning undefined ever

* More usage

* Introduce UserFriendlyError

* Use UserFriendlyError

* Add more usage instead of normal error

* Use types and translatedMessage

* Fix lints

* Update i18n although it's wrong

* Use unknown for easier creation from try/catch

* Use types

* Use error types

* Use types

* Update i18n strings

* Remove generic re-label of HTTPError

See https://github.com/matrix-org/matrix-react-sdk/pull/10432#discussion_r1156468143

The HTTPError already has a good label and it isn't even translated if we re-label it here in this way generically

Probably best to just remove in favor of thinking about a translations in general from the `matrix-js-sdk`, see https://github.com/matrix-org/matrix-js-sdk/issues/1309

* Make error message extraction generic

* Update i18n strings

* Add tests for email addresses

* More consistent error logging to actually see error in logs

* Consistent error handling

* Any is okay because we have a fallback

* Check error type

* Use dedicated mockResolvedValue function

See https://github.com/matrix-org/matrix-react-sdk/pull/10432#discussion_r1163344034
2023-04-14 15:40:19 +01:00
..
audio_messages Update tests to prefer RTL over Enzyme (#10247 2023-02-28 08:58:23 +00:00
auth Add ESLint Jest (#10261) 2023-03-01 16:23:35 +01:00
avatars Comply with noImplicitAny (#9940) 2023-02-13 11:39:16 +00:00
beacon Conform more of the codebase to strictNullChecks (#10518 2023-04-06 11:10:14 +01:00
beta Apply prettier formatting 2022-12-12 12:24:14 +01:00
context_menus Show "Invite" menu option if "UIComponent.sendInvites" is enabled. (#10363) 2023-03-28 09:10:18 +13:00
dialogs Fix send two join requests when joining a room from spotlight search (#10534) 2023-04-06 14:02:18 +00:00
elements Apply strictNullChecks to src/components/views/elements/* (#10462 2023-03-29 08:23:54 +01:00
emojipicker Sort short/exact emoji matches before longer incomplete matches (#10212) 2023-02-27 17:09:15 +00:00
location Apply strictNullChecks to src/components/views/location/* (#10249 2023-02-28 08:55:59 +00:00
messages Fix: Images no longer reserve their space in the timeline correctly (#10571) 2023-04-13 01:22:16 +00:00
polls/pollHistory replace Polls history strings with Poll history (#10454) 2023-03-28 22:13:51 +00:00
right_panel replace Polls history strings with Poll history (#10454) 2023-03-28 22:13:51 +00:00
rooms Handle more completion types in rte autocomplete (#10560) 2023-04-14 09:09:38 +00:00
settings Properly translate errors in AddThreepid.ts (#10432) 2023-04-14 15:40:19 +01:00
spaces Support dynamic room predecessors in AddExistingToSpaceDialog (#10342) 2023-03-09 17:17:28 +00:00
typography Notifications: inline error message on notifications saving error (#10288) 2023-03-13 21:59:04 +00:00
user-onboarding Remove feedback buttons from onboarding, search, and spaces (#10506) 2023-04-05 12:17:25 +01:00
voip Use the room avatar as a placeholder in calls (#10231) 2023-02-27 09:34:02 +00:00
Validation-test.ts Apply prettier formatting 2022-12-12 12:24:14 +01:00