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: Removing tasks
0014 //   As a task junkie
0015 //   I can delete a task so it is removed
0016 //   In order to clean up the old junk I accumulated
0017 class RemovingTaskFeature : public QObject
0018 {
0019     Q_OBJECT
0020 private slots:
0021     void Removing_a_simple_task_from_a_page_data()
0022     {
0023         QTest::addColumn<QString>("page");
0024         QTest::addColumn<QString>("title");
0025 
0026         QTest::newRow("inbox") << "Inbox" << "Buy cheese";
0027         QTest::newRow("readlist") << "Projects / TestData ยป Calendar1 / Read List" << "\"Domain Driven Design\" by Eric Evans";
0028     }
0029 
0030     void Removing_a_simple_task_from_a_page()
0031     {
0032         QFETCH(QString, page);
0033         QFETCH(QString, title);
0034 
0035         ZanshinContext c;
0036         Given(c.I_display_the_page(page));
0037         And(c.there_is_an_item_in_the_central_list(title));
0038         When(c.I_remove_the_item());
0039         And(c.I_list_the_items());
0040         Then(c.the_list_does_not_contain(title));
0041     }
0042 };
0043 
0044 ZANSHIN_TEST_MAIN(RemovingTaskFeature)
0045 
0046 #include "removingtaskfeature.moc"