Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Add a failing test to cover the case with missing confirg row
  • Loading branch information
grzesiek2010 committed Sep 26, 2025
commit 9643683991e9f75bd4016b081b80435cb6398b8a
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,15 @@ class ExternalSelectsTest {
.startBlankForm("dynamic_and_static_choices")
.assertTexts("Mango", "Oranges", "Strawberries", "Apples")
}

@Test
fun missingFileMessage_shouldBeDisplayedIfDynamicChoicesUsedButTheConfigurationRowIsMissing() {
val formsDirPath = StoragePathProvider().getOdkDirPath(StorageSubdirectory.FORMS)

rule.startAtMainMenu()
.copyForm("dynamic_and_static_choices.xml", listOf("fruits.csv"))
.startBlankForm("dynamic_and_static_choices")
.swipeToNextQuestion("Choose a number")
.assertText("File: $formsDirPath/dynamic_and_static_choices-media/numbers.csv is missing.")
}
}
13 changes: 13 additions & 0 deletions test-forms/src/main/resources/forms/dynamic_and_static_choices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
<instance>
<data id="dynamic_and_static_choices">
<fruits/>
<numbers/>
<meta>
<instanceID/>
</meta>
</data>
</instance>
<bind nodeset="/data/fruits" type="string"/>
<bind nodeset="/data/numbers" type="string"/>
<bind nodeset="/data/meta/instanceID" type="string" readonly="true()" jr:preload="uid"/>
</model>
</h:head>
Expand All @@ -34,5 +36,16 @@
<value>0</value>
</item>
</select1>
<select1 ref="/data/numbers" appearance="search('numbers')">
<label>Choose a number</label>
<item>
<label>0</label>
<value>0</value>
</item>
<item>
<label>1</label>
<value>1</value>
</item>
</select1>
</h:body>
</h:html>