From 1dd6d450161d27e678cffba83672973d4c7751f7 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Wed, 11 Jan 2017 09:53:27 +0100 Subject: [PATCH] tests: Add initial test coverate for TaskWikiRedo --- tests/test_selected.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/test_selected.py b/tests/test_selected.py index 728b316..88dd03d 100644 --- a/tests/test_selected.py +++ b/tests/test_selected.py @@ -141,6 +141,36 @@ class TestAnnotateActionRange(IntegrationTest): assert annotation[0]['description'] == "This is annotation." +class TestAnnotateActionRedo(IntegrationTest): + + viminput = """ + * [ ] test task 1 #{uuid} + * [ ] test task 2 #{uuid} + """ + + tasks = [ + dict(description="test task 1"), + dict(description="test task 2"), + ] + + def execute(self): + # Annotate the first task + self.command( + "TaskWikiAnnotate This is annotation.", + regex="Task \"test task 1\" annotated.$", + lines=1) + + self.tasks[0].refresh() + annotation = self.tasks[0]['annotations'] + assert annotation != [] + assert annotation[0]['description'] == "This is annotation." + + # Now also annotate the second task + self.client.type('j') + self.command("TaskWikiRedo", regex="Task \"test task 2\" annotated.$", + lines=1) + + class TestDeleteAction(IntegrationTest): viminput = """