File indexing completed on 2025-03-09 04:56:51

0001 /*
0002  * SPDX-FileCopyrightText: 2019 Kevin Ottens <ervin@kde.org>
0003    SPDX-FileCopyrightText: 2019 David Faure <faure@kde.org>
0004  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  */
0006 
0007 
0008 #include <testlib/qtest_zanshin.h>
0009 #include <featurelib/zanshincontext.h>
0010 
0011 using namespace Testlib;
0012 
0013 // Feature: Completing tasks
0014 //   As someone who just accomplished something
0015 //   I can mark a task as completed
0016 //   In order to have a warm feeling about getting it done
0017 class CompletingTaskFeature : public QObject
0018 {
0019     Q_OBJECT
0020 private slots:
0021     void Checking_task_in_the_list()
0022     {
0023         ZanshinContext c;
0024         Given(c.I_display_the_page("Inbox"));
0025         And(c.there_is_an_item_in_the_central_list("Buy cheese"));
0026         When(c.I_check_the_item());
0027         Then(c.the_task_corresponding_to_the_item_is_done());
0028     }
0029 
0030     void Checking_task_in_the_editor()
0031     {
0032         ZanshinContext c;
0033         Given(c.I_display_the_page("Inbox"));
0034         And(c.there_is_an_item_in_the_central_list("Buy apples"));
0035         When(c.I_open_the_item_in_the_editor());
0036         And(c.I_mark_the_item_done_in_the_editor());
0037         And(c.I_open_the_item_in_the_editor_again());
0038         Then(c.the_task_corresponding_to_the_item_is_done());
0039         And(c.the_editor_shows_the_task_as_done());
0040     }
0041 };
0042 
0043 ZANSHIN_TEST_MAIN(CompletingTaskFeature)
0044 
0045 #include "completingtaskfeature.moc"