setup electron app with boilerplate
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#include "testauthmanager.h"
|
||||
#include <QSignalSpy>
|
||||
|
||||
TestAuthManager::TestAuthManager(QObject *parent) : QObject{parent}, m_authManager(new AuthManager(this))
|
||||
{
|
||||
}
|
||||
|
||||
void TestAuthManager::add()
|
||||
{
|
||||
}
|
||||
|
||||
// FIX: invalid test without access to emailed code
|
||||
void TestAuthManager::testSignIn()
|
||||
{
|
||||
QSignalSpy codeSent(m_authManager, &AuthManager::codeSentToEmail);
|
||||
m_authManager->requestSignInCode("[email protected]");
|
||||
QVERIFY(codeSent.wait(5000));
|
||||
QCOMPARE(codeSent.count(), 1);
|
||||
|
||||
QSignalSpy signedIn(m_authManager, &AuthManager::isSignedInChanged);
|
||||
m_authManager->signIn("0000");
|
||||
QVERIFY(signedIn.wait(5000));
|
||||
QCOMPARE(signedIn.count(), 1);
|
||||
}
|
||||
|
||||
QTEST_MAIN(TestAuthManager)
|
||||
Reference in New Issue
Block a user