File indexing completed on 2025-01-19 04:56:43

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: Task promotion
0014 // As someone collecting tasks
0015 // I can promote a task into a project
0016 // In order to organize my tasks
0017 class ProjectTaskPromoteFeature : public QObject
0018 {
0019     Q_OBJECT
0020 private slots:
0021     void Task_promoted_into_a_project_appears_in_the_list()
0022     {
0023         ZanshinContext c;
0024         Given(c.I_display_the_page("Projects / TestData » Calendar1 » Calendar2 / Backlog"));
0025         And(c.I_add_a_task("Design a present"));
0026         And(c.I_look_at_the_central_list());
0027         And(c.there_is_an_item_in_the_central_list("Design a present"));
0028         When(c.I_promote_the_item());
0029         And(c.I_display_the_available_pages());
0030         And(c.I_list_the_items());
0031         Then(c.the_list_is({
0032                              { "display", "icon" },
0033                              {
0034                                  { "Inbox", "mail-folder-inbox" },
0035                                  { "Workday", "go-jump-today" },
0036                                  { "Projects", "folder" },
0037                                  { "Projects / TestData » Calendar1", "folder" },
0038                                  { "Projects / TestData » Calendar1 / Prepare talk about TDD", "view-pim-tasks" },
0039                                  { "Projects / TestData » Calendar1 / Read List", "view-pim-tasks" },
0040                                  { "Projects / TestData » Calendar1 » Calendar2", "folder" },
0041                                  { "Projects / TestData » Calendar1 » Calendar2 / Backlog", "view-pim-tasks" },
0042                                  { "Projects / TestData » Calendar1 » Calendar2 / Design a present", "view-pim-tasks" },
0043                                  { "Contexts", "folder" },
0044                                  { "Contexts / Errands", "view-pim-notes" },
0045                                  { "Contexts / Online", "view-pim-notes" },
0046                                  { "All Tasks", "view-pim-tasks" },
0047                              }
0048                          }));
0049     }
0050 };
0051 
0052 ZANSHIN_TEST_MAIN(ProjectTaskPromoteFeature)
0053 
0054 #include "projecttaskpromotefeature.moc"