Skip to content

test: Phase 4 - Feature module tests (154 new tests)#3542

Merged
ahmedre merged 3 commits intoquran:mainfrom
ksalhab89:feature/testing-phase4
Mar 29, 2026
Merged

test: Phase 4 - Feature module tests (154 new tests)#3542
ahmedre merged 3 commits intoquran:mainfrom
ksalhab89:feature/testing-phase4

Conversation

@ksalhab89
Copy link
Copy Markdown
Contributor

@ksalhab89 ksalhab89 commented Feb 19, 2026

Summary

Phase 4: Feature module tests. Adds 154 new unit tests across 6 modules.

Builds on Phase 3 (#3539).

New Tests

Module Tests Classes
common:search 55 SearchTextUtil, ArabicCharacterHelper, DefaultSearcher, ArabicSearcher
feature:linebyline 44 LineCalculation, AyahSelectionExtension, SelectionHelper, QuranLineByLineSettingsPresenter
feature:audiobar 12 AudioBarEventRepository
common:audio 19 PartiallyDownloadedSuraExtension, AudioStatusRepository
feature:audio 17 AudioFileCheckerImpl
feature:qarilist 7 QariListPresenter

Production Changes

One minimal interface extraction:

  • QariDownloadInfoSource interface added to common:audio
  • QariDownloadInfoManager implements it
  • QariListPresenter constructor param changed to interface
  • DI binding added in ApplicationModule

New Fakes

  • FakeSettings — implements com.quran.data.dao.Settings
  • FakeQariDownloadInfoSource — MutableStateFlow-backed
  • FakeHashCalculator — deterministic hash for AudioFileCheckerImpl tests

Test Plan

  • All 6 module test suites pass (2 consecutive runs, 0 flaky)
  • ./gradlew :app:testMadaniDebugUnitTest — regression check pass

@ksalhab89 ksalhab89 force-pushed the feature/testing-phase4 branch from 7f93839 to e4b0b59 Compare February 23, 2026 08:17
@ksalhab89 ksalhab89 force-pushed the feature/testing-phase4 branch 6 times, most recently from 3af5e54 to 3e0716a Compare March 23, 2026 09:50
- ArabicSearcherTest: extract realArabicSearcher to setUp, remove inline construction
- LineCalculationTest: fix weak assertion isAtLeast(-1) to isAnyOf(-1, 1)
- QariListPresenterTest: remove unused name parameter from helper functions
- FakeHashCalculator: remove unused shouldThrow dead code
- FakeSettings: add missing setPageType from upstream interface change
- common:search build.gradle: document why returnDefaultValues is needed
@ksalhab89 ksalhab89 force-pushed the feature/testing-phase4 branch from 3e0716a to db83570 Compare March 29, 2026 11:53
- Fix multi-collector test in AudioBarEventRepositoryTest to use
  concurrent launch instead of nested sequential test blocks
- Refactor QuranLineByLineSettingsPresenter to accept injectable
  CoroutineScope, eliminating runBlocking + Dispatchers.IO racy tests
- Migrate all LineByLine settings tests from runBlocking to runTest
- Remove replay=1 from FakeSettings.preferencesSharedFlow
- Fix LineCalculationTest: correct middle-of-page y value, add
  meaningful resizeLinesToFit assertion, fix isAnyOf(-1,1) to isEqualTo(-1)
- Remove tautological data-class test in PartiallyDownloadedSuraExtensionTest,
  replace with gap-detection test
- Strengthen DefaultSearcherTest LIMIT assertion to isEqualTo
- Add gapped section ordering test in QariListPresenterTest
- Fix misleading comment about deduplication in QariListPresenterTest
- Add selectionStart=endAyah edge case in AyahSelectionExtensionTest
- Fix comment typo in SelectionHelperTest (0.1 → 0.09f)
- Add StateFlow rationale comment in FakeQariDownloadInfoSource
- Expose FakeSearcher.queryResponse to remove magic string assertion
@github-actions
Copy link
Copy Markdown

OLD: app-madani-debug.apk (signature: V1, V2)
NEW: app-madani-debug.apk (signature: V1, V2)

          │            compressed            │           uncompressed           
          ├───────────┬───────────┬──────────┼───────────┬───────────┬──────────
 APK      │ old       │ new       │ diff     │ old       │ new       │ diff     
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
      dex │  20.3 MiB │  20.3 MiB │   +810 B │  51.3 MiB │  51.3 MiB │ +3.1 KiB 
     arsc │   2.1 MiB │   2.1 MiB │      0 B │   2.1 MiB │   2.1 MiB │      0 B 
 manifest │   5.7 KiB │   5.7 KiB │      0 B │  26.6 KiB │  26.6 KiB │      0 B 
      res │   1.8 MiB │   1.8 MiB │      0 B │     2 MiB │     2 MiB │      0 B 
   native │ 112.3 KiB │ 110.7 KiB │ -1.6 KiB │  36.5 KiB │  36.5 KiB │      0 B 
    asset │   1.8 MiB │   1.8 MiB │      0 B │   4.1 MiB │   4.1 MiB │      0 B 
    other │ 200.1 KiB │ 200.1 KiB │    -15 B │ 501.8 KiB │ 501.8 KiB │      0 B 
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
    total │  26.3 MiB │  26.3 MiB │   -825 B │    60 MiB │  60.1 MiB │ +3.1 KiB 

@ahmedre ahmedre added this pull request to the merge queue Mar 29, 2026
Merged via the queue into quran:main with commit 74ec6de Mar 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants