Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
6abab81
Dialog can't be dismissed
Ayan-10 Nov 15, 2021
e82a02e
Dialog can't be dismissed
Ayan-10 Nov 15, 2021
934aa34
Merge branch 'commons-app:master' into master
Ayan-10 Nov 27, 2021
bf0aa4f
Merge branch 'commons-app:master' into master
Ayan-10 Dec 2, 2021
e40d7ca
Merge branch 'commons-app:master' into master
Ayan-10 Dec 4, 2021
5aad0da
Option for editing depiction
Ayan-10 Dec 8, 2021
4af1f47
Java docs added
Ayan-10 Dec 10, 2021
e7d41e9
Minor issues fixed
Ayan-10 Dec 10, 2021
fe80b1c
Lining done
Ayan-10 Dec 10, 2021
5d5f530
Merge branch 'master' into 4616_edit_depicts
Ayan-10 Dec 10, 2021
d66a9da
Merge branch 'master' into 4616_edit_depicts
Ayan-10 Dec 15, 2021
c925978
"Depictions not updating instantly" issue resolved
Ayan-10 Dec 15, 2021
ba2f541
Merge branch '4616_edit_depicts' of https://github.com/Ayan-10/apps-a…
Ayan-10 Dec 15, 2021
48ae944
Merge branch 'master' into 4616_edit_depicts
Ayan-10 Dec 22, 2021
2a98e25
Merge branch 'commons-app:master' into 4616_edit_depicts
Ayan-10 Dec 29, 2021
1c1287c
Existing Depicts on the top
Ayan-10 Dec 29, 2021
d6a0102
Existing Depicts on the top
Ayan-10 Dec 29, 2021
117fe39
Back press handled
Ayan-10 Dec 30, 2021
72655ac
Previous depictions unchecked
Ayan-10 Dec 30, 2021
bf40387
Whole Screen issue fixed
Ayan-10 Dec 30, 2021
97da0ea
Nearby banner removed
Ayan-10 Dec 30, 2021
1ea8ed1
Test fixed
Ayan-10 Dec 30, 2021
34ae514
Upload Wizard issue fixed
Ayan-10 Dec 31, 2021
8d45c6e
Upload Wizard issue fixed
Ayan-10 Dec 31, 2021
15a8761
Previous depicts issue fixed
Ayan-10 Dec 31, 2021
90a5335
Previous depicts issue fixed
Ayan-10 Dec 31, 2021
204414b
All issues fixed
Ayan-10 Jan 1, 2022
d249f02
Fixed late loading of updated depicts
Ayan-10 Jan 3, 2022
3c7f59f
Merge branch 'commons-app:master' into 4616_edit_depicts
Ayan-10 Jan 3, 2022
8bd7159
Depiction is removable
Ayan-10 Jan 11, 2022
ce64828
Test fixed
Ayan-10 Jan 11, 2022
25dd674
Merge branch 'commons-app:master' into 4616_edit_depicts
Ayan-10 Jan 20, 2022
696aace
Back button press handled after losing focus for edittext
Ayan-10 Jan 21, 2022
42f3b6d
RequiresApi removed
Ayan-10 Jan 28, 2022
b8c6df6
RequiresApi removed
Ayan-10 Jan 28, 2022
dc22a82
Merge branch 'commons-app:master' into 4616_edit_depicts
Ayan-10 Feb 1, 2022
3d89390
Merge branch 'commons-app:master' into 4616_edit_depicts
Ayan-10 Feb 16, 2022
e94b9d9
Test fixed
Ayan-10 Feb 16, 2022
358e088
Merge branch 'master' into 4616_edit_depicts
Ayan-10 Feb 25, 2022
012e2b6
Merge branch 'commons-app:master' into 4616_edit_depicts
Ayan-10 Mar 18, 2022
270b16e
Requested changes
Ayan-10 Mar 18, 2022
18e0e33
Test added
Ayan-10 Mar 18, 2022
2a51562
Test added
Ayan-10 Mar 18, 2022
8cb33d4
UploadModelUnitTest added
Ayan-10 Mar 18, 2022
28e87f5
DepictEditHelperUnitTest added
Ayan-10 Mar 18, 2022
3144ae1
DepictEditHelperUnitTest added
Ayan-10 Mar 18, 2022
87a562b
Test added
Ayan-10 Mar 18, 2022
5242692
More test added
Ayan-10 Mar 19, 2022
a83d9ae
Indentation Reversed
Ayan-10 Mar 19, 2022
025fd92
Indentation reversed
Ayan-10 Mar 19, 2022
6d01519
Update MediaDetailFragment.java
Ayan-10 Mar 19, 2022
c57e372
Indentation reversed
Ayan-10 Mar 19, 2022
f658929
Update MediaDetailFragment.java
Ayan-10 Mar 19, 2022
38b8105
Indentation reversed
Ayan-10 Mar 19, 2022
93c261a
Merge branch '4616_edit_depicts' of https://github.com/Ayan-10/apps-a…
Ayan-10 Mar 19, 2022
889975b
Indentation reversed
Ayan-10 Mar 19, 2022
425a817
Indentation reversed
Ayan-10 Mar 19, 2022
4af8c17
Indentation reversed
Ayan-10 Mar 19, 2022
faa9e30
More test added
Ayan-10 Mar 20, 2022
f454db9
More test added
Ayan-10 Mar 20, 2022
5d1925e
Minor fixes
Ayan-10 Mar 21, 2022
960b844
Minor fixes
Ayan-10 Mar 21, 2022
e647f8b
Minor fixes
Ayan-10 Mar 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More test added
  • Loading branch information
Ayan-10 committed Mar 20, 2022
commit f454db9dce7cb1d66d289c3200b47fc612cbce99
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ public Observable<Long> getFileEntityId(UploadResult uploadResult) {
.map(response -> (long) (response.query().pages().get(0).pageId()));
}

public Observable<Long> getFileEntityIdByFileName(String fileName) {
return wikiBaseInterface.getFileEntityId(fileName)
.map(response -> (long) (response.query().pages().get(0).pageId()));
}

public Observable<MwPostResponse> addLabelstoWikidata(long fileEntityId,
String languageCode, String captionValue) {
return csrfToken()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,20 @@ class UploadModelUnitTest {
), null)
}

@Test
fun `Test onDepictItemClicked when media is not null and DepictedItem is selected`(){
uploadModel.onDepictItemClicked(
DepictedItem(
"Test",
"Test",
"test",
listOf(),
listOf(),
true,
"id"
), media(filename = "File:Example.jpg"))
}

@Test
fun `Test onDepictItemClicked when media is null and DepictedItem is selected`(){
uploadModel.onDepictItemClicked(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,12 @@ class DepictEditHelperUnitTest {
context,
context.getString(R.string.depict_edit_helper_make_edit_toast)
)
// Mockito.verify(pageEditClient, Mockito.times(1))
// .getCurrentWikiText(ArgumentMatchers.anyString())
// Mockito.verify(pageEditClient, Mockito.times(1)).edit(
// ArgumentMatchers.anyString(),
// ArgumentMatchers.anyString(),
// ArgumentMatchers.anyString()
// )
}

@Test
@Throws(Exception::class)
fun testShowCoordinatesEditNotificationCaseTrue() {
whenever(media.depictionIds).thenReturn(listOf("id", "id2"))
val method: Method = DepictEditHelper::class.java.getDeclaredMethod(
"showDepictionEditNotification",
Context::class.java,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package fr.free.nrw.commons.wikidata

import org.junit.Before
import org.junit.Test
import org.mockito.InjectMocks
import org.mockito.Mock
import org.mockito.Mockito
import org.mockito.MockitoAnnotations
import org.wikipedia.csrf.CsrfTokenClient

class WikiBaseClientUnitTest {

@Mock
internal var csrfTokenClient: CsrfTokenClient? = null

@InjectMocks
var wikiBaseClient: WikiBaseClient? = null

@Before
@Throws(Exception::class)
fun setUp() {
MockitoAnnotations.initMocks(this)
Mockito.`when`(csrfTokenClient!!.tokenBlocking)
.thenReturn("test")
}

@Test
fun testPostEditEntityByFilename() {
wikiBaseClient?.postEditEntityByFilename("File:Example.jpg", "data")
}
}