Skip to content

Commit

Permalink
added more test
Browse files Browse the repository at this point in the history
  • Loading branch information
anandwana001 committed Nov 28, 2024
1 parent d372c94 commit d62ebb5
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ class SubmissionMutationConverterTest {
ids = listOf("option id 1", "option id 2", "[ other value ]"),
)

private val multipleChoiceTaskDataOtherEmpty =
MultipleChoiceTaskData.fromList(
MultipleChoice(
persistentListOf(
Option("option id 1", "code1", "Option 1"),
Option("option id 2", "code2", "Option 2"),
),
MultipleChoice.Cardinality.SELECT_MULTIPLE,
),
ids = listOf("[ ]"),
)

private val numberTaskData = NumberTaskData.fromNumber("123")

private val dropPinTaskResult = DropPinTaskData(Point(Coordinates(10.0, 20.0)))
Expand Down Expand Up @@ -197,6 +209,11 @@ class SubmissionMutationConverterTest {
taskType = Task.Type.MULTIPLE_CHOICE,
newTaskData = multipleChoiceTaskDataOther,
),
ValueDelta(
taskId = "multiple_choice_task_other_empty_value",
taskType = Task.Type.MULTIPLE_CHOICE,
newTaskData = multipleChoiceTaskDataOtherEmpty,
),
ValueDelta(
taskId = "number_task",
taskType = Task.Type.NUMBER,
Expand Down Expand Up @@ -257,6 +274,11 @@ class SubmissionMutationConverterTest {
),
TASK_ID_FIELD_NUMBER.toString() to "multiple_choice_task_other",
),
mapOf(
MULTIPLE_CHOICE_RESPONSES_FIELD_NUMBER.toString() to
mapOf(OTHER_SELECTED_FIELD_NUMBER.toString() to true),
TASK_ID_FIELD_NUMBER.toString() to "multiple_choice_task_other_empty_value",
),
mapOf(
NUMBER_RESPONSE_FIELD_NUMBER.toString() to mapOf(NUMBER_FIELD_NUMBER.toString() to 123.0),
TASK_ID_FIELD_NUMBER.toString() to "number_task",
Expand Down

0 comments on commit d62ebb5

Please sign in to comment.