Commit graph

74 commits

Author SHA1 Message Date
Benoit Marty
4572419ed2
Stronger lambda error (#4771)
* Make sure lambdaError() make the test fail in all circumstances.

* Fix existing errors on tests.

* Uniformize the way we are creating class under test.

* Cleanup

* Fix typo

* Fix failing test after rebase.
2025-05-27 15:32:09 +00:00
Jorge Martin Espinosa
f455085e08
Notification events resolving and rendering in batches (#4722)
- Use `NotiticationService.getNotifications()` function so we resolve the events in bulk.
- Added `NotifierResolverQueue` to group the notifications to resolve based on a debounce strategy.
- Batch rendering of these events as notifications.
2025-05-26 17:10:20 +02:00
Jorge Martin Espinosa
fd50ce4daf
Add user verification and verification state violation badges (#4392)
* Move `observeRoomMemberIdentityStateChange` and associated classes to `libs:matrixui` module so they can be reused

* Add `EncryptionService.getUserIdentity` method to retrieve not only if the user is verified or not, but in which state they are

* Fix `IdentityChangePresenter` after the previous changes

* Fix `withFakeLifecycleOwner` and add `testWithLifecycleOwner` helper

* Display verified badge in DM top app bar when possible

* Display a verification violation warning icon next to the 'People' item in room details screen

* Display either a verified badge or a verification violation warning icon next to the room members in the room member list screen

* Display either a verified badge or a verification violation warning and withdraw verification button in the room member profile.

Generic user profiles won't display verification state anymore since we can't easily track changes in it.

* Add preview for room member details screen with verification violation identity state

* Add verified and violation badge to the `Profile` list item in room details screen

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-03-12 12:22:53 +01:00
Jorge Martin Espinosa
f73c0e42a4
Implement user verification (#4294)
* Add support for starting verification of a user

* Add support for replying to incoming user verification requests

* Add reset recovery key button and previews to `ChooseSelfVerificationModeView`

* Add 'Profile' item in room details screen

* Update screenshots

* Remove `showDeviceVerifiedScreen` parameter from `NavTarget.UseAnotherDevice`

* Allow exiting the FTUE flow, which will close the app. The previous state will be restored when the app is reopened.

* When outgoing verification fails, move to the `Canceled` state. Then, when resetting the state machine state also reset the verification service.

---------

Co-authored-by: ElementBot <android@element.io>
2025-03-10 11:20:17 +01:00
Benoit Marty
2e9a158fb0 Update Matrix Room API and allow media swipe on pinned event only. 2025-02-17 16:45:25 +01:00
Benoit Marty
8f281ffa3c Extract testEnv to the test module 2025-02-05 15:20:18 +01:00
Benoit Marty
7878f97453 Update incoming call notification content to "📹 Incoming call" 2025-02-04 16:20:53 +01:00
Benoit Marty
97f3be3dc5 Apply dual licenses: AGPL + Element Commercial to file headers.
2 replace all actions have been performed:
- "SPDX-License-Identifier: AGPL-3.0-only" to "SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial"
- "Please see LICENSE in the repository root for full details." to "Please see LICENSE files in the repository root for full details."
2025-01-07 10:05:04 +01:00
Benoit Marty
da272ddb07 Implement month separator for the Gallery.
Improve day separator rendering in the timeline.
Use Today, Yesterday, and the name of the day if less than 7 days and do not render the year for the current year.
Improve date format for the media viewer.
Rework how date and time are computed.
ActionListView: Time can take more space, so update the layout.
2024-12-11 23:57:57 +01:00
Benoit Marty
8dfe5300b8 Rename parameter. 2024-11-08 10:11:06 +01:00
Benoit Marty
585b6a94f3 Delete temporary created files. 2024-11-08 10:11:06 +01:00
Benoit Marty
25e3aa6fc4 Remove runBlocking usage in LambdaRecorder. 2024-10-16 10:03:18 +02:00
Jorge Martin Espinosa
366db4791b
Upgrade Kotlin to v2.0 (#3594)
* Bump Kotlin to v2.0

* Fix lots of issues due to the upgrade: lint issues, function signature incompatibilities, broken tests, etc.

---------

Co-authored-by: Benoit Marty <benoit@matrix.org>
2024-10-10 08:32:00 +00:00
Benoit Marty
29356b96c1
Merge pull request #3554 from element-hq/feature/bma/testEmptyTimeline
Add unit tests on TimelineItemsSubscriber
2024-10-02 14:04:48 +02:00
Jorge Martin Espinosa
79c17f714f
Use Anvil KSP instead of the Square KAPT one (#3564)
* Use Anvil KSP instead of the Square KAPT one

* Fix several configuration cache, lint and test issues

* Allow incremental kotlin compilation in the CI

* Workaround Robolectric + Compose issue that caused `AppNotIdleException`

* Update the `enterprise` commit hash

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2024-10-02 11:52:17 +00:00
Benoit Marty
f89463c3a1 Remove runCancellableScopeTest and runCancellableScopeTestWithTestScope, we can use TestScope.backgroundScope instead. 2024-09-27 18:37:16 +02:00
renovate[bot]
9756afc5d1
Update dependency androidx.compose:compose-bom to v2024.09.00 (#3399)
* Update dependency androidx.compose:compose-bom to v2024.09.00

* Adapt code for changes.

* Workaround crash when closing the RTE

* Fix broken bottom sheet colors and shape

* Fix tons of warnings and deprecations

* Fix lint issues

* Fix more M3 update changes

* Update screenshots

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
Co-authored-by: ElementBot <benoitm+elementbot@element.io>
Co-authored-by: ganfra <francoisg@matrix.org>
Co-authored-by: ElementBot <android@element.io>
2024-09-26 09:30:20 +02:00
Benoit Marty
d1be4349f0 Add test on RustRoomDirectoryList 2024-09-19 15:40:25 +02:00
Benoit Marty
f61df38e55 Migrate license to AGPL.
Run script `uv run license-editor --repository ../element-x-android`
2024-09-06 17:19:19 +02:00
Jorge Martin Espinosa
5944f112fb
Subscribe to RoomListItems in the visible range (#3169)
* Subscribe to `RoomListItems` in the visible range

This ensures the room list items always have updated info.
2024-07-11 10:54:56 +02:00
Benoit Marty
b409f2ea19 Remove extra parenthesis 2024-07-08 13:19:35 +02:00
Benoit Marty
0093e611cd Add Ui test on CallScreenView 2024-07-08 12:30:06 +02:00
Jorge Martin Espinosa
b0cebf5ca0
Improve screenshot testing with ComposablePreviewScanner (#3125)
* Use ComposablePreviewScanner to rework how screenshot testing works
* Add test sharding
* Update screenshots
* Fixes for Element Gallery

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2024-07-03 13:05:06 +02:00
Jorge Martin Espinosa
30a1367714
Element Call ringing notifications (#2978)
- Add `ActiveCallManager` to handle incoming and ongoing calls.
- Add ringing call notifications with full screen intents and missed call ones as part of the 'conversation' notifications.

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2024-06-10 11:51:19 +02:00
Jorge Martin Espinosa
04e503177b
Notifications: simplify the flow by removing persistence (#2924)
* Notifications: simplify the flow by removing persistence. 
* Bump of minSdk to `24` (Android 7).
* Add migration to remove `notification.bin` file
2024-05-29 08:03:23 +00:00
Benoit Marty
f04253287f Introduce lambdaError instead of using TODO, to handle error when a lambda is invoked and it should not. 2024-05-23 09:12:40 +02:00
Jorge Martin Espinosa
5dddda64d1
UX cleanup: DM details screen (#2820)
* UX cleanup: user profile.

- Move send DM to a CTA button.
- Add 'Call' CTA button too when there is a DM with that user and a call is possible.
- Add missing tests.

* Update screenshots

* Add tests for clicking on the avatar

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2024-05-08 16:05:02 +02:00
ganfra
bffa2d717f Timeline : continue to fix more tests... 2024-04-25 12:41:34 +02:00
ganfra
3f1f764745 Room directory : add tests and cleanup 2024-03-28 17:03:34 +01:00
ganfra
19523339af Tests : improve lambda recorder 2024-03-28 14:59:22 +01:00
ganfra
44125567f6 Tests : create lambda recorder 2024-03-28 10:34:12 +01:00
Jorge Martin Espinosa
5cc5a0b699
Add isInDebug variable to simulate debug/release configs for tests (#2566)
* `isInDebug` as `ThreadLocal<Boolean>`

* Use a simple var for `isInDebug` and add a helper method to test release mode, when running the debug test.

* Add some more docs

---------

Co-authored-by: Benoit Marty <benoit@matrix.org>
2024-03-18 17:56:07 +01:00
ganfra
65fa3bf6a4 Tests: raise default timeout of consumeItemsUntilPredicate to 3 seconds (like awaitItem) 2024-03-13 12:44:59 +01:00
ganfra
427b3f7c0f Merge branch 'develop' into feature/fga/room_list_filter_iteration 2024-03-13 12:07:20 +01:00
Jorge Martin Espinosa
59a682b407
Change a room's permissions power levels (#2525)
* Change a room's permissions power levels

* Make `currentPermissions` use a `MatrixRoomPowerLevels?` instance instead.

* Update strings

* Update screenshots

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2024-03-12 15:45:06 +01:00
ganfra
bf68261ed9 RoomList: refactor and fix tests 2024-03-12 15:38:33 +01:00
Benoit Marty
3684761bcd Add test on RoomDetailsView 2024-02-22 15:23:22 +01:00
Benoit Marty
849f1021fd Improve test framework. 2024-02-21 18:30:57 +01:00
Benoit Marty
093d201266 Add missing period. 2024-02-07 23:23:49 +01:00
Benoit Marty
fa52ff54c8 Add tests on MessagesView 2024-02-07 23:02:32 +01:00
Benoit Marty
4e0f308cac Add result type to EnsureCalledOnceWithParam 2024-02-07 23:02:32 +01:00
Benoit Marty
b25509a611 Add test for TimelineItemPollView 2024-02-06 18:30:27 +01:00
Benoit Marty
e66f53f64c Add test to ensure that TimelineView loads more Events. 2024-02-06 17:12:14 +01:00
Jorge Martin Espinosa
da4825aa44
Return cached room members before fetching new ones, do it in batches (#2274)
* Use cached users from the Rust SDK.

Also lazy load received users by batches.

* Create `RoomMemberListFetcher` to wrap all the room member loading logic

* Ensure we clear `RoomMember` Rust references if the fetching coroutine is canceled
2024-01-23 18:23:20 +01:00
Benoit Marty
5e42368965 Add missing test for LogoutView 2024-01-09 17:53:24 +01:00
Benoit Marty
2a6a3ded5e Iterate on EnsureCalledOnce devX 2024-01-08 10:07:48 +01:00
Benoit Marty
2c667a0dc0 Add run method to EnsureCalledOnce and EnsureCalledOnceWithParam to ensure that assertSuccess is always called. 2024-01-08 10:01:26 +01:00
Benoit Marty
dee8008917 Use string resource instead of hard-coded strings. 2024-01-08 09:50:08 +01:00
Benoit Marty
fdc3c9ff39 Improve assertion message. 2024-01-08 09:35:14 +01:00
Benoit Marty
44ad93f625 Add first tests on compose click interaction. 2024-01-05 18:00:44 +01:00