mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 21:33:53 +01:00
Add test for DepictedItem::primaryImage
This commit is contained in:
parent
46624da622
commit
63af24ebfc
1 changed files with 16 additions and 0 deletions
|
|
@ -181,4 +181,20 @@ class DepictedItemTest {
|
|||
fun `hashCode returns different values for objects with different name`() {
|
||||
Assert.assertNotEquals(depictedItem(name = "a").hashCode(), depictedItem(name = "b").hashCode())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `primaryImage is derived correctly from imageUrl`() {
|
||||
Assert.assertEquals(
|
||||
DepictedItem(
|
||||
entity(
|
||||
statements = mapOf(
|
||||
WikidataProperties.IMAGE.propertyName to listOf(
|
||||
statement(snak(dataValue = valueString("prefix: example_image name"))),
|
||||
),
|
||||
),
|
||||
),
|
||||
).primaryImage,
|
||||
"_example_image_name",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue