Commit 956f2b38 authored by Alexander Stippich's avatar Alexander Stippich

Add a test for multiple properties

Reviewers: bruns, ngraham

Reviewed By: bruns, ngraham

Subscribers: ngraham, #baloo

Tags: #baloo

Differential Revision: https://phabricator.kde.org/D20740
parent bfef0997
......@@ -192,3 +192,18 @@ void FileMetadataWidgetTest::shouldShowCommonProperties()
// QCOMPARE( map->value("Album Artist:"), QLatin1String("Bill Laswell"));
}
void FileMetadataWidgetTest::shouldShowMultiValueProperties()
{
QSignalSpy spy(m_widget, &Baloo::FileMetaDataWidget::metaDataRequestFinished);
m_widget->setItems(KFileItemList()
<< QUrl::fromLocalFile(QFINDTESTDATA("samplefiles/test_multivalue.ogg"))
);
QVERIFY(spy.wait());
QCOMPARE(spy.count(), 1);
auto artistWidget = m_widget->findChild<QLabel*>(QStringLiteral("artist"));
QVERIFY2(artistWidget, "artist not found");
QCOMPARE(artistWidget->text(), "Artist1 and Artist2");
auto genreWidget = m_widget->findChild<QLabel*>(QStringLiteral("genre"));
QVERIFY2(genreWidget, "genre not found");
QCOMPARE(genreWidget->text(), "Genre1, Genre2, and Genre3");
}
......@@ -37,6 +37,7 @@ private Q_SLOTS:
void shouldSignalOnceFiles();
void shouldShowProperties();
void shouldShowCommonProperties();
void shouldShowMultiValueProperties();
private:
Baloo::FileMetaDataWidget* m_widget;
......
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