-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f482e7e
commit 5e1953a
Showing
13 changed files
with
95 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
Sources/NodesTesting/Mocks/ObservableViewStateStoreMock.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// Copyright © 2024 Tinder (Match Group, LLC) | ||
// | ||
|
||
#if canImport(SwiftUI) | ||
|
||
import Nodes | ||
import SwiftUI | ||
|
||
@preconcurrency | ||
@MainActor | ||
public final class ObservableViewStateStoreMock<ViewState: Equatable>: ObservableViewStateStore { | ||
|
||
@Published | ||
public var viewState: ViewState { | ||
didSet { viewStateSetCallCount += 1 } | ||
} | ||
|
||
public private(set) var viewStateSetCallCount: Int = 0 | ||
|
||
public init(viewState: ViewState) { | ||
self.viewState = viewState | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// Copyright © 2024 Tinder (Match Group, LLC) | ||
// | ||
|
||
#if canImport(Observation) | ||
|
||
import Nodes | ||
import Observation | ||
|
||
@Observable | ||
@preconcurrency | ||
@MainActor | ||
@available(macOS 14.0, macCatalyst 17.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *) | ||
public final class StateStoreMock<State: Equatable>: StateStore { | ||
|
||
public var state: State { | ||
didSet { stateSetCallCount += 1 } | ||
} | ||
|
||
public private(set) var stateSetCallCount: Int = 0 | ||
|
||
public init(state: State) { | ||
self.state = state | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters