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: Drop a task on workday view
0014 //   As someone reviewing his tasks
0015 //   I can drag a task from the current view and drop it in the workday view
0016 //   In order to have the task start today
0017 class WorkdayDropFeature : public QObject
0018 {
0019     Q_OBJECT
0020 private slots:
0021     void Dropping_a_task_on_Workday_page()
0022     {
0023         ZanshinContext c;
0024         Given(c.I_display_the_page("Inbox"));
0025         And(c.I_add_a_task("Buy Pineapples"));
0026         And(c.there_is_an_item_in_the_central_list("Buy Pineapples"));
0027         When(c.I_drop_the_item_on_the_page_list("Workday"));
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 Pineapples"));
0032     }
0033 
0034     void Dropping_two_tasks_on_Workday_page()
0035     {
0036         ZanshinContext c;
0037         Given(c.I_display_the_page("Inbox"));
0038         And(c.I_add_a_task("Don't eat the cake"));
0039         And(c.I_add_a_task("The cake is a lie"));
0040         And(c.the_central_list_contains_items_named({
0041                                  "Don't eat the cake",
0042                                  "The cake is a lie",
0043                              }));
0044         When(c.I_drop_items_on_the_page_list("Workday"));
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("Don't eat the cake"));
0049         And(c.the_list_contains("The cake is a lie"));
0050     }
0051 };
0052 
0053 ZANSHIN_TEST_MAIN(WorkdayDropFeature)
0054 
0055 #include "workdaydropfeature.moc"