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'
This commit is contained in:
Fonic 2017-12-19 11:10:32 +01:00
parent 34a7ba4477
commit 268035ff9e

View File

@ -288,9 +288,15 @@ void TestEntryModel::testProxyModel()
modelSource->setGroup(db->rootGroup());
/**
* @author Fonic <https://github.com/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 <https://github.com/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();