Verified Commit 2356621a authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Fix QSignalSpy usage in the tag widget tests

parent 7c7e8cd4
......@@ -209,7 +209,7 @@ private Q_SLOTS:
QVERIFY(!test.newTagButton->isEnabled());
QVERIFY(!test.newTagEdit->isEnabled());
QVERIFY(monitorSpy.wait());
QTRY_COMPARE(monitorSpy.size(), 1);
test.createdTags.push_back(monitorSpy.at(0).at(0).value<Akonadi::Tag>());
QCOMPARE(test.model->rowCount(), 2);
QCOMPARE(test.model->data(test.model->index(1, 0), Qt::DisplayRole).toString(), tagName);
......@@ -230,7 +230,7 @@ private Q_SLOTS:
QVERIFY(!test.newTagButton->isEnabled());
QVERIFY(!test.newTagEdit->isEnabled());
QVERIFY(monitorSpy.wait());
QTRY_COMPARE(monitorSpy.size(), 1);
test.createdTags.push_back(monitorSpy.at(0).at(0).value<Akonadi::Tag>());
QCOMPARE(test.model->rowCount(), 2);
QCOMPARE(test.model->data(test.model->index(1, 0), Qt::DisplayRole).toString(), tagName);
......@@ -336,7 +336,7 @@ private Q_SLOTS:
QVERIFY(test.deleteTag(tag, true));
// Wait for confirmation
QVERIFY(monitorSpy.wait());
QTRY_COMPARE(monitorSpy.size(), 1);
QCOMPARE(monitorSpy.at(0).at(0).value<Tag>(), tag);
test.createdTags.pop_back(); // remove the tag from the list
......
......@@ -100,7 +100,8 @@ class TagWidgetTest: public QObject
std::transform(selection.begin(), selection.end(), std::back_inserter(names), std::bind(&Tag::name, std::placeholders::_1));
AKCOMPARE(widget->selection(), selection);
AKVERIFY(selectionSpy.wait());
AKCOMPARE(selectionSpy.size(), 1);
AKCOMPARE(selectionSpy.at(0).at(0).value<Tag::List>(), selection);
AKCOMPARE(tagView->text(), names.join(QStringLiteral(", ")));
return true;
......@@ -196,7 +197,7 @@ private Q_SLOTS:
QSignalSpy selectionSpy(test.widget.get(), &TagWidget::selectionChanged);
test.widget->clearTags();
QVERIFY(test.widget->selection().isEmpty());
QVERIFY(selectionSpy.wait());
QCOMPARE(selectionSpy.size(), 1);
QVERIFY(selectionSpy.at(0).at(0).value<Tag::List>().empty());
QVERIFY(test.tagView->text().isEmpty());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment