Origin: code review of PR #54. Two test gaps in the folder-label feature, verified by mutation analysis.
1. The attributes → specialUse wiring has zero coverage
The single production link between server data and the feature — toEntity's specialUse = FolderRole.isServerSpecial(attributes) (Mappers.kt:163) and toDomain's pass-through (Mappers.kt:153) — is never executed with meaningful values by any test:
FetchedFolder appears in zero test files; every listFolders stub returns emptyList().
All other tests hand-set specialUse on their own layer (FolderRoleTest tests the predicate, LibreMailDatabaseTest the DAO column, FolderLabelsTest/FolderDrawerTest the domain/UI).
Mutation-verified: delete Mappers.kt:163 and everything compiles via FolderEntity's specialUse = false default; refreshFolders persists 0 for every folder, the provider-suffix branch goes dead, real Gmail accounts regress to "Drafts ([Gmail])" — while assembleDebug, testDebugUnitTest, and connectedDebugAndroidTest all stay green.
Fix: a ~12-line MailRepositoryImplTest case — stub imapClient.listFolders with FetchedFolder("[Gmail]/Drafts", "Drafts", listOf("\\Drafts"), selectable = true) plus an attribute-less folder, slot-capture folderDao.replaceForAccount, assert persisted specialUse == [true, false]. Optionally assert specialUse in the existing observeFolders test for the toDomain leg.
baseLabelsOf's doc comment (FolderLabelsTest.kt:31) says it builds labels "the way the drawer does", but it's a hand-copied mirror of folderDisplayLabel with hardcoded English literals. A wording change to folder_archive/folder_spam/folder_trash (or a new folderDisplayLabel branch) leaves the suite green against the stale copy — and the androidTest fixtures use displayName == friendly name for those roles, so they can't discriminate drift either.
Fix: drop the fidelity claim (state it's an independent literal fixture) or inline expected literals per test; optionally add one androidTest fixture where displayName ≠ friendly name for ARCHIVE/SPAM/TRASH.
Origin: code review of PR #54. Two test gaps in the folder-label feature, verified by mutation analysis.
## 1. The attributes → specialUse wiring has zero coverage
The single production link between server data and the feature — `toEntity`'s `specialUse = FolderRole.isServerSpecial(attributes)` (`Mappers.kt:163`) and `toDomain`'s pass-through (`Mappers.kt:153`) — is never executed with meaningful values by any test:
- `FetchedFolder` appears in **zero** test files; every `listFolders` stub returns `emptyList()`.
- All other tests hand-set `specialUse` on their own layer (`FolderRoleTest` tests the predicate, `LibreMailDatabaseTest` the DAO column, `FolderLabelsTest`/`FolderDrawerTest` the domain/UI).
Mutation-verified: delete `Mappers.kt:163` and everything compiles via `FolderEntity`'s `specialUse = false` default; `refreshFolders` persists 0 for every folder, the provider-suffix branch goes dead, real Gmail accounts regress to "Drafts ([Gmail])" — while `assembleDebug`, `testDebugUnitTest`, and `connectedDebugAndroidTest` all stay green.
**Fix:** a ~12-line `MailRepositoryImplTest` case — stub `imapClient.listFolders` with `FetchedFolder("[Gmail]/Drafts", "Drafts", listOf("\\Drafts"), selectable = true)` plus an attribute-less folder, slot-capture `folderDao.replaceForAccount`, assert persisted `specialUse == [true, false]`. Optionally assert `specialUse` in the existing `observeFolders` test for the `toDomain` leg.
## 2. FolderLabelsTest's fixture claims fidelity nothing enforces
`baseLabelsOf`'s doc comment (`FolderLabelsTest.kt:31`) says it builds labels "the way the drawer does", but it's a hand-copied mirror of `folderDisplayLabel` with hardcoded English literals. A wording change to `folder_archive`/`folder_spam`/`folder_trash` (or a new `folderDisplayLabel` branch) leaves the suite green against the stale copy — and the androidTest fixtures use `displayName == friendly name` for those roles, so they can't discriminate drift either.
**Fix:** drop the fidelity claim (state it's an independent literal fixture) or inline expected literals per test; optionally add one androidTest fixture where displayName ≠ friendly name for ARCHIVE/SPAM/TRASH.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Origin: code review of PR #54. Two test gaps in the folder-label feature, verified by mutation analysis.
1. The attributes → specialUse wiring has zero coverage
The single production link between server data and the feature —
toEntity'sspecialUse = FolderRole.isServerSpecial(attributes)(Mappers.kt:163) andtoDomain's pass-through (Mappers.kt:153) — is never executed with meaningful values by any test:FetchedFolderappears in zero test files; everylistFoldersstub returnsemptyList().specialUseon their own layer (FolderRoleTesttests the predicate,LibreMailDatabaseTestthe DAO column,FolderLabelsTest/FolderDrawerTestthe domain/UI).Mutation-verified: delete
Mappers.kt:163and everything compiles viaFolderEntity'sspecialUse = falsedefault;refreshFolderspersists 0 for every folder, the provider-suffix branch goes dead, real Gmail accounts regress to "Drafts ([Gmail])" — whileassembleDebug,testDebugUnitTest, andconnectedDebugAndroidTestall stay green.Fix: a ~12-line
MailRepositoryImplTestcase — stubimapClient.listFolderswithFetchedFolder("[Gmail]/Drafts", "Drafts", listOf("\\Drafts"), selectable = true)plus an attribute-less folder, slot-capturefolderDao.replaceForAccount, assert persistedspecialUse == [true, false]. Optionally assertspecialUsein the existingobserveFolderstest for thetoDomainleg.2. FolderLabelsTest's fixture claims fidelity nothing enforces
baseLabelsOf's doc comment (FolderLabelsTest.kt:31) says it builds labels "the way the drawer does", but it's a hand-copied mirror offolderDisplayLabelwith hardcoded English literals. A wording change tofolder_archive/folder_spam/folder_trash(or a newfolderDisplayLabelbranch) leaves the suite green against the stale copy — and the androidTest fixtures usedisplayName == friendly namefor those roles, so they can't discriminate drift either.Fix: drop the fidelity claim (state it's an independent literal fixture) or inline expected literals per test; optionally add one androidTest fixture where displayName ≠ friendly name for ARCHIVE/SPAM/TRASH.