1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-20 11:47:46 +00:00

Ensure the profilesChanged signal works in the ProfileManagerTest

This commit is contained in:
Joshua Goins 2024-08-22 19:00:09 -04:00
parent 33441f06d0
commit aabe60cdf1

View file

@ -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);