summaryrefslogtreecommitdiff
path: root/tests/script_test.sh
diff options
context:
space:
mode:
authorTobias Brox <t@tobixen.no>2015-05-04 00:45:44 +0200
committerTobias Brox <t@tobixen.no>2015-05-04 00:45:44 +0200
commit2889e3eb58c837ab0bf68517aba2eb7257f11cff (patch)
tree78eeeb94d484eb9958f5465bd1ed12f4baaa4a08 /tests/script_test.sh
parentda1fcd5f9cc4f64795e28a9eeb2be7125541d24a (diff)
downloadcalendar-cli-2889e3eb58c837ab0bf68517aba2eb7257f11cff.zip
new feature: hide parent task if we need to work on children tasks (think of parent as dependent on the children to be done)
Diffstat (limited to 'tests/script_test.sh')
-rwxr-xr-xtests/script_test.sh27
1 files changed, 25 insertions, 2 deletions
diff --git a/tests/script_test.sh b/tests/script_test.sh
index 375acdb..1636478 100755
--- a/tests/script_test.sh
+++ b/tests/script_test.sh
@@ -70,7 +70,7 @@ calendar_cli todo --categories scripttest list
[ $(echo "$output" | wc -l) == 1 ] && echo "## OK: found the todo item we just added and nothing more"
echo "## Editing the task"
-calendar_cli todo --categories scripttest edit --set-comment "editing" --add-categories "scripttest2"
+calendar_cli todo --categories scripttest edit --set-summary "editing" --add-categories "scripttest2"
echo "## Verifying that the edits got through"
calendar_cli todo --categories scripttest list
@@ -84,6 +84,29 @@ echo "## Complete the task"
calendar_cli todo --categories scripttest complete
calendar_cli todo --categories scripttest list
[ -z "$output" ] && echo "## OK: todo-item is done"
-calendar_cli todo --todo-uid $todouid1 delete
+calendar_cli todo --todo-uid $uidtodo1 delete
+
+## parent-child relationships
+echo "## Going to add three todo-items with children/parent relationships"
+calendar_cli todo add --set-categories scripttest "this is a grandparent"
+uidtodo2=$(echo $output | perl -ne '/uid=(.*)$/ && print $1')
+calendar_cli todo --categories=scripttest add --set-categories scripttest --is-child "this is a parent and a child"
+uidtodo3=$(echo $output | perl -ne '/uid=(.*)$/ && print $1')
+calendar_cli todo --categories=scripttest add --set-categories scripttest --is-child "this task has two parents"
+uidtodo4=$(echo $output | perl -ne '/uid=(.*)$/ && print $1')
+calendar_cli todo --categories scripttest list
+[ $(echo "$output" | wc -l) == 3 ] && echo "## OK: found three tasks"
+calendar_cli todo --hide-parents --categories scripttest list
+[ $(echo "$output" | wc -l) == 1 ] && echo "## OK: found only one task now"
+echo "## Going to complete the children task"
+calendar_cli todo --hide-parents --categories scripttest complete
+calendar_cli todo --hide-parents --categories scripttest list
+[ $(echo "$output" | wc -l) == 1 ] && echo "## OK: found only one task now"
+calendar_cli todo --hide-parents --categories scripttest complete
+calendar_cli todo --hide-parents --categories scripttest list
+[ $(echo "$output" | wc -l) == 1 ] && echo "## OK: found only one task now"
+calendar_cli todo --hide-parents --categories scripttest complete
+calendar_cli todo --hide-parents --categories scripttest list
+[ -z "$output" ] && echo "## OK: found no tasks now"
echo "## all tests completed"