Skip to content

Commit

Permalink
update unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSmart00 committed Jul 27, 2024
1 parent 9ab2fd7 commit 21e7f62
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions app-ios/Tests/SponsorFeatureTests/SponsorFeatureTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,31 @@ final class SponsorFeatureTests: XCTestCase {

@MainActor
func testExample() async throws {
let store = TestStore(initialState: SponsorReducer.State(text: "HOGE")) {
let store = TestStore(initialState: SponsorReducer.State()) {
SponsorReducer()
} withDependencies: {
$0.sponsorsClient.streamSponsors = {
AsyncThrowingStream {
$0.yield([
.init(name: "Hoge", logo: "https://avatars.githubusercontent.com/u/10727543?s=200&v=4", plan: .platinum, link: "https://2024.droidkaigi.jp/"),
.init(name: "Huga", logo: "https://avatars.githubusercontent.com/u/10727543?s=200&v=4", plan: .gold, link: "https://2024.droidkaigi.jp/"),
.init(name: "FUga", logo: "https://avatars.githubusercontent.com/u/10727543?s=200&v=4", plan: .supporter, link: "https://2024.droidkaigi.jp/"),
])
$0.finish()
}
}
}
await store.send(.onAppear) {
$0.text = "Sponsor Feature"
await store.send(.onAppear)
await store.receive(\.response.success) {
$0.platinums = [
.init(id: "Hoge", logo: .init(string: "https://avatars.githubusercontent.com/u/10727543?s=200&v=4")!, link: .init(string: "https://2024.droidkaigi.jp/")!)
]
$0.golds = [
.init(id: "Huga", logo: .init(string: "https://avatars.githubusercontent.com/u/10727543?s=200&v=4")!, link: .init(string: "https://2024.droidkaigi.jp/")!)
]
$0.supporters = [
.init(id: "FUga", logo: .init(string: "https://avatars.githubusercontent.com/u/10727543?s=200&v=4")!, link: .init(string: "https://2024.droidkaigi.jp/")!)
]
}
}

Expand Down

0 comments on commit 21e7f62

Please sign in to comment.