mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-20 03:37:47 +00:00
Ensure the profilesChanged signal works in the ProfileManagerTest
This commit is contained in:
parent
33441f06d0
commit
aabe60cdf1
1 changed files with 10 additions and 0 deletions
|
@ -15,9 +15,14 @@ private Q_SLOTS:
|
|||
ProfileManager profileManager;
|
||||
QAbstractItemModelTester modelTester(&profileManager);
|
||||
|
||||
const QSignalSpy profilesChangedSpy(&profileManager, &ProfileManager::profilesChanged);
|
||||
QVERIFY(profilesChangedSpy.isValid());
|
||||
|
||||
QCOMPARE(profileManager.rowCount({}), 0);
|
||||
profileManager.load();
|
||||
|
||||
QCOMPARE(profilesChangedSpy.count(), 1);
|
||||
|
||||
// the dummy profile
|
||||
QCOMPARE(profileManager.rowCount({}), 1);
|
||||
QCOMPARE(profileManager.numProfiles(), 1);
|
||||
|
@ -36,10 +41,15 @@ private Q_SLOTS:
|
|||
ProfileManager profileManager;
|
||||
QAbstractItemModelTester modelTester(&profileManager);
|
||||
|
||||
const QSignalSpy profilesChangedSpy(&profileManager, &ProfileManager::profilesChanged);
|
||||
QVERIFY(profilesChangedSpy.isValid());
|
||||
|
||||
QCOMPARE(profileManager.rowCount({}), 0);
|
||||
profileManager.load();
|
||||
QCOMPARE(profilesChangedSpy.count(), 1);
|
||||
|
||||
profileManager.addProfile();
|
||||
QCOMPARE(profilesChangedSpy.count(), 2);
|
||||
|
||||
QCOMPARE(profileManager.rowCount({}), 2);
|
||||
QCOMPARE(profileManager.numProfiles(), 2);
|
||||
|
|
Loading…
Add table
Reference in a new issue