Skip to content

Commit

Permalink
ensure correct error code for email (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Gehorsam authored Oct 27, 2023
1 parent c56c3d2 commit 5fd7592
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions test/src/test_errors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace Test {

using namespace std;

void test_error_NotFound()
void test_error_NotFoundDevice()
{
NTest test(__func__);

Expand All @@ -42,6 +42,26 @@ void test_error_NotFound()
test.runTest();
}

void test_error_NotFoundEmail()
{
NTest test(__func__);

auto successCallback = [&test](NSessionPtr session)
{
NLOG_INFO("session token: " + session->getAuthToken());
test.stopTest(false);
};

auto errorCallback = [&test](const NError& error)
{
test.stopTest(error.code == ErrorCode::NotFound);
};

test.client->authenticateEmail("email_not_found@gmail.com", "no_password", "", false, {}, successCallback, errorCallback);

test.runTest();
}

void test_error_InvalidArgument()
{
NTest test(__func__);
Expand Down Expand Up @@ -100,7 +120,8 @@ void test_error_Unauthenticated()

void test_errors()
{
test_error_NotFound();
test_error_NotFoundEmail();
test_error_NotFoundDevice();
test_error_InvalidArgument();
test_error_InvalidArgument2();
test_error_Unauthenticated();
Expand Down

0 comments on commit 5fd7592

Please sign in to comment.