From 268035ff9e81d6d4689931346decb73d31d1e4f1 Mon Sep 17 00:00:00 2001 From: Fonic Date: Tue, 19 Dec 2017 11:10:32 +0100 Subject: [PATCH] Update entry model test to account for additional columns Update comparison values of modelProxy->columnCount() to account for additional columns 'Password', 'Notes', 'Expires', 'Created', 'Modified', 'Accessed' and 'Attachments' --- tests/TestEntryModel.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/TestEntryModel.cpp b/tests/TestEntryModel.cpp index ad7c9060a..49ae3b0d1 100644 --- a/tests/TestEntryModel.cpp +++ b/tests/TestEntryModel.cpp @@ -288,9 +288,15 @@ void TestEntryModel::testProxyModel() modelSource->setGroup(db->rootGroup()); + /** + * @author Fonic + * Update comparison value of modelProxy->columnCount() to account for + * additional columns 'Password', 'Notes', 'Expires', 'Created', 'Modified', + * 'Accessed' and 'Attachments' + */ QSignalSpy spyColumnRemove(modelProxy, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int))); modelProxy->hideColumn(0, true); - QCOMPARE(modelProxy->columnCount(), 3); + QCOMPARE(modelProxy->columnCount(), 10); QVERIFY(spyColumnRemove.size() >= 1); int oldSpyColumnRemoveSize = spyColumnRemove.size(); @@ -304,9 +310,15 @@ void TestEntryModel::testProxyModel() entryList << entry; modelSource->setEntryList(entryList); + /** + * @author Fonic + * Update comparison value of modelProxy->columnCount() to account for + * additional columns 'Password', 'Notes', 'Expires', 'Created', 'Modified', + * 'Accessed' and 'Attachments' + */ QSignalSpy spyColumnInsert(modelProxy, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int))); modelProxy->hideColumn(0, false); - QCOMPARE(modelProxy->columnCount(), 4); + QCOMPARE(modelProxy->columnCount(), 11); QVERIFY(spyColumnInsert.size() >= 1); int oldSpyColumnInsertSize = spyColumnInsert.size();