-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathHelpWebViewModelTests.swift
51 lines (35 loc) · 1.51 KB
/
HelpWebViewModelTests.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
@testable import Library
@testable import Kickstarter_Framework
@testable import ReactiveExtensions_TestHelpers
import Prelude
import ReactiveSwift
import Result
import XCTest
internal final class HelpWebViewModelTests: TestCase {
fileprivate let vm: HelpWebViewModelType = HelpWebViewModel()
fileprivate let webViewLoadRequest = TestObserver<String, NoError>()
override func setUp() {
super.setUp()
self.vm.outputs.webViewLoadRequest.map { $0.url?.relativePath ?? "" }
.observe(self.webViewLoadRequest.observer)
}
func testWebRequestURLString() {
self.vm.inputs.configureWith(helpType: .cookie)
self.webViewLoadRequest.assertValueCount(0)
self.vm.inputs.viewDidLoad()
self.webViewLoadRequest.assertValues(["/cookies"])
self.vm.inputs.configureWith(helpType: .faq)
self.vm.inputs.viewDidLoad()
self.webViewLoadRequest.assertValues(["/cookies", "/help/faq/kickstarter+basics"])
self.vm.inputs.configureWith(helpType: .howItWorks)
self.vm.inputs.viewDidLoad()
self.webViewLoadRequest.assertValues(["/cookies", "/help/faq/kickstarter+basics", "/about"])
self.vm.inputs.configureWith(helpType: .privacy)
self.vm.inputs.viewDidLoad()
self.webViewLoadRequest.assertValues(["/cookies", "/help/faq/kickstarter+basics", "/about", "/privacy"])
self.vm.inputs.configureWith(helpType: .terms)
self.vm.inputs.viewDidLoad()
self.webViewLoadRequest.assertValues(["/cookies", "/help/faq/kickstarter+basics", "/about", "/privacy",
"/terms-of-use"])
}
}