-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
EmptyStatesViewControllerTests.swift
45 lines (37 loc) · 1.57 KB
/
EmptyStatesViewControllerTests.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
@testable import Kickstarter_Framework
@testable import KsApi
@testable import Library
import Prelude
import XCTest
internal final class EmptyStatesViewControllerTests: TestCase {
override func setUp() {
super.setUp()
AppEnvironment.pushEnvironment(mainBundle: Bundle.framework)
UIView.setAnimationsEnabled(false)
}
override func tearDown() {
AppEnvironment.popEnvironment()
UIView.setAnimationsEnabled(true)
super.tearDown()
}
func testEmptyStates() {
let emptyStates = [EmptyState.activity, .recommended, .starred, .socialDisabled, .socialNoPledges]
combos(Language.allLanguages, emptyStates).forEach { language, emptyState in
withEnvironment(language: language) {
let controller = EmptyStatesViewController.configuredWith(emptyState: emptyState)
let (parent, _) = traitControllers(device: .phone4_7inch, orientation: .portrait, child: controller)
FBSnapshotVerifyView(parent.view, identifier: "_\(emptyState.rawValue)_lang_\(language)")
}
}
}
func testEmptyStates_iPad() {
let emptyStates = [EmptyState.activity, .recommended, .starred, .socialDisabled, .socialNoPledges]
combos(Language.allLanguages, emptyStates).forEach { language, emptyState in
withEnvironment(language: language) {
let controller = EmptyStatesViewController.configuredWith(emptyState: emptyState)
let (parent, _) = traitControllers(device: .pad, orientation: .portrait, child: controller)
FBSnapshotVerifyView(parent.view, identifier: "_\(emptyState.rawValue)_lang_\(language)")
}
}
}
}