Skip to content

Commit df8ee5d

Browse files
committed
Refactor ChessPieceTests to use forCorrect method for piece determination
- Updated test cases to replace `piece(for:)` with `piece(forCorrect:)` for consistency in lead evaluations. - Ensured that all lead scenarios (negative, zero, positive) correctly utilize the new method. - Maintained the integrity of the tests while improving clarity and accuracy in lead handling.
1 parent 8636b80 commit df8ee5d

8 files changed

Lines changed: 3685 additions & 1717 deletions

File tree

Modules/Core/Utils/EmailHistoryStore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
struct EmailHistoryStore {
3+
enum EmailHistoryStore {
44
private static let key = "dm.auth.email_history"
55

66
static func getHistory() -> [String] {

Modules/Core/Wrappers/OTPServiceProtocol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ struct OTPServiceStub: OTPServiceProtocol {
99
func sendMagicLink(to email: String) async throws {
1010
try await Task.sleep(nanoseconds: 1_000_000_000)
1111
#if DEBUG
12-
print("[OTP Stub] Magic link enviado a \(email)")
12+
print("[OTP Stub] Magic link enviado a \(email)")
1313
#endif
1414
}
1515

Modules/Data/Local/LocalStore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ final class LocalStore<Entity: Codable & Identifiable> where Entity.ID: Hashable
8282
try data.write(to: fileURL, options: .atomic)
8383
} catch {
8484
#if DEBUG
85-
print("[LocalStore] persist error: \(error)")
85+
print("[LocalStore] persist error: \(error)")
8686
#endif
8787
}
8888
}

Modules/Data/Remote/SupabaseAuthService.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ final class SupabaseAuthService: ObservableObject, AuthRepository {
6262
let errorMsg = error.localizedDescription
6363
errorMessage = errorMsg
6464
if errorMsg.localizedCaseInsensitiveContains("email not confirmed") ||
65-
errorMsg.localizedCaseInsensitiveContains("confirm") {
65+
errorMsg.localizedCaseInsensitiveContains("confirm")
66+
{
6667
return .failure(.emailConfirmationRequired("Tu correo no está confirmado. Por favor ingresa el código de confirmación."))
6768
}
6869
return .failure(.unknown(errorMsg))

Modules/Data/Remote/SupabaseCommunityRepository.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ final class SupabaseCommunityRepository: ObservableObject, CommunityRepository {
150150
if let date = formatter.date(from: string) { return date }
151151
formatter.formatOptions = [.withInternetDateTime]
152152
if let date = formatter.date(from: string) { return date }
153-
throw DecodingError.dataCorruptedError(
154-
in: try dec.singleValueContainer(),
153+
throw try DecodingError.dataCorruptedError(
154+
in: dec.singleValueContainer(),
155155
debugDescription: "Invalid date: \(string)"
156156
)
157157
}

Modules/Features/Auth/ViewModels/RegisterViewModel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class RegisterViewModel: ObservableObject {
3535
}
3636

3737
func setAuthService(_ service: any AuthRepository) {
38-
self.activeAuthService = service
38+
activeAuthService = service
3939
}
4040

4141
private var authService: any AuthRepository {
@@ -70,7 +70,7 @@ class RegisterViewModel: ObservableObject {
7070
.debounce(for: .milliseconds(800), scheduler: RunLoop.main)
7171
.sink { [weak self] value in
7272
guard let self else { return }
73-
if self.emailError == nil && !value.trimmingCharacters(in: .whitespaces).isEmpty {
73+
if self.emailError == nil, !value.trimmingCharacters(in: .whitespaces).isEmpty {
7474
Task { await self.checkEmailAvailability(value) }
7575
} else {
7676
self.emailExists = nil

0 commit comments

Comments
 (0)