Skip to content

Commit

Permalink
run swift-format
Browse files Browse the repository at this point in the history
  • Loading branch information
ski-u authored and github-actions[bot] committed Dec 17, 2024
1 parent 68a929e commit a16c92c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Features/Sources/Settings/APIKey/APIKeySetting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public struct APIKeySetting {
case setAPIKeyInput(String)
case updateButtonTapped
}

@Dependency(\.apiKeyClient) private var apiKeyClient

public init() {}
Expand Down
2 changes: 1 addition & 1 deletion Features/Sources/Settings/Settings/Settings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public struct Settings {
case path(StackActionOf<Path>)
case popToRoot
}

@Dependency(\.apiKeyClient) private var apiKeyClient

public var body: some ReducerOf<Self> {
Expand Down
13 changes: 7 additions & 6 deletions Features/Tests/SettingsTests/APIKeySettingTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import ComposableArchitecture
@testable import Settings
import Testing

@testable import Settings

@MainActor
struct APIKeySettingTests {
@Test
Expand All @@ -11,28 +12,28 @@ struct APIKeySettingTests {
) {
APIKeySetting()
}

await store.send(.setAPIKeyInput("test")) {
$0.apiKeyInput = .init(rawValue: "test")
}
}

@Test
func onAppear() async throws {
let store = TestStore(
initialState: APIKeySetting.State()
) {
APIKeySetting()
}

store.dependencies.apiKeyClient.getKey = {
.init(rawValue: "test")
}

await store.send(.onAppear) {
$0.apiKeyInput = .init(rawValue: "test")
}
}

// TODO: add test case for `updateButtonTapped`
}
2 changes: 1 addition & 1 deletion Features/Tests/SettingsTests/APIKeyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ struct APIKeyTests {
func masked() {
var key = APIKey(rawValue: "")
#expect(key.masked == nil)

key = .init(rawValue: "test")
#expect(key.masked == "t***")
}
Expand Down
4 changes: 2 additions & 2 deletions Features/Tests/SettingsTests/SettingsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ struct SettingsTests {
) {
Settings()
}

store.dependencies.apiKeyClient.getKey = {
.init(rawValue: "test")
}

await store.send(.onAppear) {
$0.apiKey = .init(rawValue: "test")
}
Expand Down

0 comments on commit a16c92c

Please sign in to comment.