Skip to content

Commit

Permalink
adds tests for queryData initiatedBy
Browse files Browse the repository at this point in the history
  • Loading branch information
Jtang-1 committed Jan 22, 2024
1 parent 7bee616 commit 8b600f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/org/commcare/formplayer/objects/QueryData.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ public String getInitiatedBy(String key) {
return null;
}

public void setInitiatedBy(String key, String value) {
this.initKey(key);
((Map<String, Object>) this.get(key)).put(INITIATED_BY, value);
}

public Hashtable<String, String> getInputs(String key) {
Map<String, Object> value = (Map<String, Object>) this.get(key);
if (value != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,13 @@ public void testQueryPromptGrouped() throws Exception {
assertEquals(queryResponseBean.getDisplays()[4].getGroupKey(), groupKey2);
}

@Test
public void testQueryInitiatedBy() throws Exception {
QueryData queryData = new QueryData();
queryData.setInitiatedBy("search_command.m1_results", "field_change");
assertEquals(queryData.getInitiatedBy("search_command.m1_results"), "field_change");
}

@Test
public void testDependentItemsets_DependentChoicesChangeWithSelection() throws Exception {
Hashtable<String, String> inputs = new Hashtable<>();
Expand Down

0 comments on commit 8b600f5

Please sign in to comment.