Fix empty username (#6209)

* revert changes from #5860

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* read author prop instead

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* Use user prop if author is empty or null

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* fix test

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

---------

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
This commit is contained in:
Parneet Singh 2025-03-08 18:56:41 +05:30 committed by GitHub
parent 32d485cc51
commit 972bf785f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 29 additions and 26 deletions

View file

@ -96,7 +96,7 @@ class DeleteHelperTest {
).thenReturn("Media successfully deleted: Test Media Title")
val creatorName = "Creator"
whenever(media.author).thenReturn("$creatorName")
whenever(media.getAuthorOrUser()).thenReturn("$creatorName")
whenever(media.filename).thenReturn("Test file.jpg")
val makeDeletion = deleteHelper.makeDeletion(
context,
@ -133,7 +133,7 @@ class DeleteHelperTest {
whenever(media.displayTitle).thenReturn("Test file")
whenever(media.filename).thenReturn("Test file.jpg")
whenever(media.author).thenReturn("Creator (page does not exist)")
whenever(media.getAuthorOrUser()).thenReturn("Creator (page does not exist)")
deleteHelper.makeDeletion(context, media, "Test reason")?.blockingGet()
}
@ -148,7 +148,7 @@ class DeleteHelperTest {
.thenReturn(Observable.just(false))
whenever(media.displayTitle).thenReturn("Test file")
whenever(media.filename).thenReturn("Test file.jpg")
whenever(media.author).thenReturn("Creator (page does not exist)")
whenever(media.getAuthorOrUser()).thenReturn("Creator (page does not exist)")
deleteHelper.makeDeletion(context, media, "Test reason")?.blockingGet()
}
@ -163,7 +163,7 @@ class DeleteHelperTest {
.thenReturn(Observable.just(true))
whenever(media.displayTitle).thenReturn("Test file")
whenever(media.filename).thenReturn("Test file.jpg")
whenever(media.author).thenReturn("Creator (page does not exist)")
whenever(media.getAuthorOrUser()).thenReturn("Creator (page does not exist)")
deleteHelper.makeDeletion(context, media, "Test reason")?.blockingGet()
}
@ -221,7 +221,7 @@ class DeleteHelperTest {
whenever(media.displayTitle).thenReturn("Test file")
whenever(media.filename).thenReturn("Test file.jpg")
whenever(media.author).thenReturn(null)
whenever(media.getAuthorOrUser()).thenReturn(null)
deleteHelper.makeDeletion(context, media, "Test reason")?.blockingGet()
}