mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-28 03:49:20 +03:00
Test important properties in testfiletagmodel
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
73b94bcf2f
commit
ce22c409e1
1 changed files with 22 additions and 0 deletions
|
@ -104,6 +104,28 @@ private slots:
|
|||
};
|
||||
}
|
||||
|
||||
void testModelMainProps()
|
||||
{
|
||||
auto fileTagModel = FileTagModel(testFilePath, _account);
|
||||
const auto fileTagModelTester = QAbstractItemModelTester(&fileTagModel);
|
||||
QSignalSpy fileTagsChanged(&fileTagModel, &FileTagModel::totalTagsChanged);
|
||||
fileTagsChanged.wait(1000);
|
||||
|
||||
QCOMPARE(fileTagModel.serverRelativePath(), testFilePath);
|
||||
QCOMPARE(fileTagModel.account(), _account);
|
||||
|
||||
QSignalSpy serverRelativePathChangedSpy(&fileTagModel, &FileTagModel::serverRelativePathChanged);
|
||||
fileTagModel.setServerRelativePath("");
|
||||
QCOMPARE(serverRelativePathChangedSpy.count(), 1);
|
||||
QCOMPARE(fileTagModel.serverRelativePath(), "");
|
||||
|
||||
QSignalSpy accountChangedSpy(&fileTagModel, &FileTagModel::accountChanged);
|
||||
const AccountPtr testAccount;
|
||||
fileTagModel.setAccount(testAccount);
|
||||
QCOMPARE(accountChangedSpy.count(), 1);
|
||||
QCOMPARE(fileTagModel.account(), testAccount);
|
||||
}
|
||||
|
||||
void testModelTagFetch()
|
||||
{
|
||||
auto fileTagModel = FileTagModel(testFilePath, _account);
|
||||
|
|
Loading…
Reference in a new issue