element-hq / element-hq/element-x-android

Improve VoiceMessageComposerPresenterTest

Open
#4,770 0 comments 0 reactions 0 assignees View on GitHub
O-Uncommon S-Tolerable T-Task
Dominant language
Kotlin
Stars
2.4k
Forks
624
Avg merge
1d 14h
Merged PRs (30d)
149

Description

For instance:
- `RECORDING_STATE` should be splitted into several intermediate states, because `FakeVoiceRecorder` emits all the states at the same time in the method `startRecord()`. A delay should be added [here](https://github.com/element-hq/element-x-android/blob/develop/libraries/voicerecorder/test/src/main/kotlin/io/element/android/libraries/voicerecorder/test/FakeVoiceRecorder.kt#L50).
- `FakeVoiceRecorder` could take some lambda in the constructor parameter to follow our current pattern. It coulde replace the method `FakeVoiceRecorder.assertCalls` and `FakeVoiceRecorder.givenThrowsSecurityException`
- Doing the change above makes some tests to fails, in particular `error("Previous recording was not cleared")` is invoked. This should be fixed, maybe `FakeVoiceRecorder` is a bit too clever?

Contributor guide

Open the contributing guide

Research direction

Start with VoiceMessageComposerPresenterTest and the FakeVoiceRecorder implementation, especially startRecord(), assertCalls, and givenThrowsSecurityException. Separate the recorder states and consider constructor lambdas as described, then run the affected presenter tests and verify the previous-recording error is no longer triggered unexpectedly.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev, testing
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.