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: Context task association
0014 //   As someone collecting tasks
0015 //   I can associate tasks to a context
0016 //   In order to describe the tasks resources
0017 class ContextDragAndDropFeature : public QObject
0018 {
0019     Q_OBJECT
0020 private slots:
0021     void Dropping_a_task_on_a_context_from_the_inbox()
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_drop_the_item_on_the_page_list("Contexts / Errands"));
0027         And(c.I_display_the_page("Contexts / Errands"));
0028         And(c.I_look_at_the_central_list());
0029         And(c.I_list_the_items());
0030         Then(c.the_list_is({
0031                              { "display" },
0032                              {
0033                                  { "Buy kiwis" },
0034                                  { "Buy rutabagas" },
0035                              }
0036                          }));
0037     }
0038 
0039     void Dropping_a_task_on_a_context_from_the_project_central_list()
0040     {
0041         ZanshinContext c;
0042         Given(c.I_display_the_page("Projects / TestData ยป Calendar1 / Prepare talk about TDD"));
0043         And(c.there_is_an_item_in_the_central_list("Create examples and exercices"));
0044         When(c.I_drop_the_item_on_the_page_list("Contexts / Online"));
0045         And(c.I_display_the_page("Contexts / Online"));
0046         And(c.I_look_at_the_central_list());
0047         And(c.I_list_the_items());
0048         Then(c.the_list_is({
0049                              { "display" },
0050                              {
0051                                  { "Create examples and exercices" },
0052                                  { "Create examples and exercices / Train for the FizzBuzz kata" },
0053                                  { "Create examples and exercices / Train for the Gilded Rose kata" },
0054                              }
0055                          }));
0056     }
0057 };
0058 
0059 ZANSHIN_TEST_MAIN(ContextDragAndDropFeature)
0060 
0061 #include "contextdraganddropfeature.moc"