27 lines
678 B
C++
27 lines
678 B
C++
#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("arjun@flowylabs.ai");
|
|
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)
|