Skip to content

Commit a50a877

Browse files
committed
test: fix tests
1 parent f57b19e commit a50a877

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/Packages/Passport/Runtime/Scripts/Private/Core/BrowserCommunicationsManager.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@ private void HandleResponse(string message)
163163
// Validate the deserialised response object
164164
if (response == null || string.IsNullOrEmpty(response.responseFor) || string.IsNullOrEmpty(response.requestId))
165165
{
166-
string responseError = "Response from browser is incorrect. Check game bridge file.";
167-
PassportLogger.Error(responseError);
168-
throw new PassportException(responseError);
166+
throw new PassportException("Response from browser is incorrect. Check game bridge file.");
169167
}
170168

171169
string logMessage = $"{TAG} Response for: {response.responseFor} (request ID: {response.requestId}) : {message}";

src/Packages/Passport/Runtime/Scripts/Private/PassportImpl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ public async UniTask<string> GetLogoutUrl()
533533
{
534534
string response = await communicationsManager.Call(PassportFunction.LOGOUT);
535535
string logoutUrl = response.GetStringResult();
536-
if (String.IsNullOrEmpty(logoutUrl))
536+
if (string.IsNullOrEmpty(logoutUrl))
537537
{
538538
throw new PassportException("Failed to get logout URL", PassportErrorType.AUTHENTICATION_ERROR);
539539
}

src/Packages/Passport/Tests/Runtime/Scripts/PassportTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using Immutable.Browser.Core;
1010
using UnityEngine;
1111
using Immutable.Passport.Helpers;
12+
using UnityEngine.TestTools;
1213

1314
namespace Immutable.Passport
1415
{
@@ -1072,6 +1073,7 @@ public async Task Logout_FailedGetLogoutUrl()
10721073
e = ex;
10731074
}
10741075

1076+
LogAssert.Expect(LogType.Error, "[Immutable] [Passport Implementation] Failed to log out: Response is invalid!");
10751077
Assert.NotNull(e);
10761078

10771079
Assert.AreEqual(0, urlsOpened.Count);
@@ -1103,6 +1105,7 @@ public async Task Logout_EmptyGetLogoutUrl()
11031105
e = ex;
11041106
}
11051107

1108+
LogAssert.Expect(LogType.Error, "[Immutable] [Passport Implementation] Failed to log out: Failed to get logout URL");
11061109
Assert.NotNull(e);
11071110

11081111
Assert.AreEqual(0, urlsOpened.Count);

0 commit comments

Comments
 (0)