fix(tests): wait until ModFolderModel has updated

This commit is contained in:
Sefa Eyeoglu 2022-06-12 12:39:04 +02:00
parent 8856c8cd62
commit 32217a774f
No known key found for this signature in database
GPG Key ID: C10411294912A422

View File

@ -32,8 +32,11 @@ slots:
{ {
QString folder = source; QString folder = source;
QTemporaryDir tempDir; QTemporaryDir tempDir;
QEventLoop loop;
ModFolderModel m(tempDir.path(), true); ModFolderModel m(tempDir.path(), true);
connect(&m, &ModFolderModel::updateFinished, &loop, &QEventLoop::quit);
m.installMod(folder); m.installMod(folder);
loop.exec();
verify(tempDir.path()); verify(tempDir.path());
} }
@ -41,8 +44,11 @@ slots:
{ {
QString folder = source + '/'; QString folder = source + '/';
QTemporaryDir tempDir; QTemporaryDir tempDir;
QEventLoop loop;
ModFolderModel m(tempDir.path(), true); ModFolderModel m(tempDir.path(), true);
connect(&m, &ModFolderModel::updateFinished, &loop, &QEventLoop::quit);
m.installMod(folder); m.installMod(folder);
loop.exec();
verify(tempDir.path()); verify(tempDir.path());
} }
} }