File indexing completed on 2025-01-05 04:59:48
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: Modifying a task's due date 0014 // As someone adding a task 0015 // I can set the due date by editing the field "due date" 0016 // In order to have a task that ends at the entered date 0017 class WorkdayDuedateEditFeature : public QObject 0018 { 0019 Q_OBJECT 0020 private slots: 0021 void Setting_a_date_s_due_date_to_today_makes_it_appear_in_the_Workday_page() 0022 { 0023 ZanshinContext c; 0024 Given(c.I_display_the_page("Inbox")); 0025 And(c.I_add_a_task("Make more test tasks")); 0026 And(c.there_is_an_item_in_the_central_list("Make more test tasks")); 0027 When(c.I_open_the_item_in_the_editor()); 0028 And(c.I_change_the_editor_field("due date", "2015-03-10")); 0029 And(c.I_display_the_page("Workday")); 0030 And(c.I_look_at_the_central_list()); 0031 And(c.I_list_the_items()); 0032 Then(c.the_list_contains("Make more test tasks")); 0033 } 0034 0035 void Setting_a_date_s_due_date_to_a_date_in_the_past_makes_it_appear_in_the_Workday_page() 0036 { 0037 ZanshinContext c; 0038 Given(c.I_display_the_page("Inbox")); 0039 And(c.I_add_a_task("Buy potatoes")); 0040 And(c.there_is_an_item_in_the_central_list("Buy potatoes")); 0041 When(c.I_open_the_item_in_the_editor()); 0042 And(c.I_change_the_editor_field("due date", "2001-03-10")); 0043 And(c.I_display_the_page("Workday")); 0044 And(c.I_look_at_the_central_list()); 0045 And(c.I_list_the_items()); 0046 Then(c.the_list_contains("Buy potatoes")); 0047 } 0048 }; 0049 0050 ZANSHIN_TEST_MAIN(WorkdayDuedateEditFeature) 0051 0052 #include "workdayduedateeditfeature.moc"