Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
grdsdev committed Dec 3, 2024
1 parent 862c40b commit 56af12c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
4 changes: 3 additions & 1 deletion Tests/AuthTests/AuthClientMultipleInstancesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
// Created by Guilherme Souza on 05/07/24.
//

@testable import Auth
import TestHelpers
import XCTest

@testable import Auth

@MainActor
final class AuthClientMultipleInstancesTests: XCTestCase {
func testMultipleAuthClientInstances() {
let url = URL(string: "http://localhost:54321/auth")!
Expand Down
1 change: 1 addition & 0 deletions Tests/AuthTests/AuthClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import XCTest
import FoundationNetworking
#endif

@MainActor
final class AuthClientTests: XCTestCase {
var sessionManager: SessionManager!

Expand Down
16 changes: 10 additions & 6 deletions Tests/AuthTests/RequestsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@
// Created by Guilherme Souza on 07/10/23.
//

@testable import Auth
import Helpers
import InlineSnapshotTesting
import SnapshotTesting
import TestHelpers
import XCTest

@testable import Auth

#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

struct UnimplementedError: Error {}

@MainActor
final class RequestsTests: XCTestCase {
func testSignUpWithEmailAndPassword() async {
let sut = makeSUT()
Expand Down Expand Up @@ -126,7 +128,7 @@ final class RequestsTests: XCTestCase {
url,
URL(
string:
"http://localhost:54321/auth/v1/authorize?provider=github&scopes=read,write&redirect_to=https://dummy-url.com/redirect&extra_key=extra_value"
"http://localhost:54321/auth/v1/authorize?provider=github&scopes=read,write&redirect_to=https://dummy-url.com/redirect&extra_key=extra_value"
)!
)
}
Expand All @@ -152,7 +154,7 @@ final class RequestsTests: XCTestCase {

let url = URL(
string:
"https://dummy-url.com/callback#access_token=accesstoken&expires_in=60&refresh_token=refreshtoken&token_type=bearer"
"https://dummy-url.com/callback#access_token=accesstoken&expires_in=60&refresh_token=refreshtoken&token_type=bearer"
)!

let session = try await sut.session(from: url)
Expand All @@ -173,7 +175,7 @@ final class RequestsTests: XCTestCase {

let url = URL(
string:
"https://dummy-url.com/callback#access_token=accesstoken&expires_in=60&refresh_token=refreshtoken"
"https://dummy-url.com/callback#access_token=accesstoken&expires_in=60&refresh_token=refreshtoken"
)!

do {
Expand Down Expand Up @@ -430,7 +432,8 @@ final class RequestsTests: XCTestCase {
Dependencies[sut.clientID].sessionStorage.store(.validSession)

await assert {
_ = try await sut.mfa.enroll(params: MFAEnrollParams(issuer: "supabase.com", friendlyName: "test"))
_ = try await sut.mfa.enroll(
params: MFAEnrollParams(issuer: "supabase.com", friendlyName: "test"))
}
}

Expand Down Expand Up @@ -480,7 +483,8 @@ final class RequestsTests: XCTestCase {
Dependencies[sut.clientID].sessionStorage.store(.validSession)

await assert {
_ = try await sut.mfa.verify(params: .init(factorId: "123", challengeId: "123", code: "123456"))
_ = try await sut.mfa.verify(
params: .init(factorId: "123", challengeId: "123", code: "123456"))
}
}

Expand Down

0 comments on commit 56af12c

Please sign in to comment.