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 start date
0014 // As someone using tasks
0015 // I can modify the start date of tasks to today 
0016 // In order to have them plan from today
0017 class WorkdayStartdateEditFeature : public QObject
0018 {
0019     Q_OBJECT
0020 private slots:
0021     void Setting_a_date_s_start_date_to_today_makes_it_appear_in_the_workday_view()
0022     {
0023         ZanshinContext c;
0024         Given(c.I_display_the_page("Inbox"));
0025         And(c.there_is_an_item_in_the_central_list("Buy rutabagas"));
0026         When(c.I_open_the_item_in_the_editor());
0027         And(c.I_change_the_editor_field("start date", "2015-03-10"));
0028         And(c.I_display_the_page("Workday"));
0029         And(c.I_look_at_the_central_list());
0030         And(c.I_list_the_items());
0031         Then(c.the_list_contains("Buy rutabagas"));
0032     }
0033 
0034     void Setting_a_date_s_start_date_to_a_date_in_the_past_makes_it_appear_in_the_workday_view()
0035     {
0036         ZanshinContext c;
0037         Given(c.I_display_the_page("Workday"));
0038         And(c.I_look_at_the_central_list());
0039         And(c.I_list_the_items());
0040         And(c.the_list_does_not_contain("Buy rutabagas"));
0041         And(c.I_display_the_page("Inbox"));
0042         And(c.there_is_an_item_in_the_central_list("Buy rutabagas"));
0043         When(c.I_open_the_item_in_the_editor());
0044         And(c.I_change_the_editor_field("start date", "2014-03-10"));
0045         And(c.I_display_the_page("Workday"));
0046         And(c.I_look_at_the_central_list());
0047         And(c.I_list_the_items());
0048         Then(c.the_list_contains("Buy rutabagas"));
0049     }
0050 };
0051 
0052 ZANSHIN_TEST_MAIN(WorkdayStartdateEditFeature)
0053 
0054 #include "workdaystartdateeditfeature.moc"