From 5516e4826ce8937bf9a0d776ade93559ba4de9e7 Mon Sep 17 00:00:00 2001 From: YuLong Yao Date: Thu, 18 May 2023 17:30:18 +0800 Subject: [PATCH] test: add guiUndo action --- tests/test_graphical.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_graphical.py b/tests/test_graphical.py index cabcfea..6311bb4 100755 --- a/tests/test_graphical.py +++ b/tests/test_graphical.py @@ -102,6 +102,19 @@ class TestReviewActions: reviews_after = ac.cardReviews(deck="test_deck", startID=0) assert len(reviews_after) == len(reviews_before) + 1 + def test_guiUndo(self, reviewing_started): + ac.guiShowAnswer() + reviews_before = ac.cardReviews(deck="test_deck", startID=0) + assert ac.guiAnswerCard(ease=4) is True + + reviews_after_answer = ac.cardReviews(deck="test_deck", startID=0) + assert len(reviews_after_answer) == len(reviews_before) + 1 + + assert ac.guiUndo() is True + + reviews_after_undo = ac.cardReviews(deck="test_deck", startID=0) + assert len(reviews_after_undo) == len(reviews_before) + class TestSelectedNotes: def test_with_valid_deck_query(self, setup):