Skip to content
This repository was archived by the owner on Mar 10, 2022. It is now read-only.

Commit edd8d48

Browse files
authored
Merge pull request #32 from nodes-ios/develop
1.1
2 parents 67c931b + fb4577a commit edd8d48

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ osx_image: xcode8.1
33
branches:
44
only:
55
- master
6-
6+
- develop
77
env:
88
global:
99
- PROJECT_NAME="Spinner.xcodeproj"
@@ -31,4 +31,4 @@ script:
3131
- xcodebuild -project "$PROJECT_NAME" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty;
3232

3333
after_success:
34-
- bash <(curl -s https://codecov.io/bash)
34+
- bash <(curl -s https://codecov.io/bash)

SpinnerTests/SpinnerTests.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,24 @@ class SpinnerTests: XCTestCase {
119119
XCTAssertTrue(view.isUserInteractionEnabled)
120120
}
121121

122+
func testShowCustomSpinnerInButton() {
123+
_ = SpinnerView.showCustomSpinner(inButton: button, disablesUserInteraction: true)
124+
var hasSpinner = button.subviews.contains {$0 is Spinner}
125+
XCTAssert(hasSpinner && !button.isUserInteractionEnabled)
126+
127+
_ = SpinnerView.showCustomSpinner(inButton: button, disablesUserInteraction: false)
128+
hasSpinner = button.subviews.contains {$0 is Spinner}
129+
XCTAssert(hasSpinner && button.isUserInteractionEnabled)
130+
}
131+
132+
func testDismissCustomSpinnerInButton() {
133+
let spinner = SpinnerView.showCustomSpinner(inButton: button, disablesUserInteraction: true)
134+
spinner.dismiss()
135+
let hasSpinner = button.subviews.contains {$0 is Spinner}
136+
XCTAssertFalse(hasSpinner)
137+
XCTAssertTrue(view.isUserInteractionEnabled)
138+
}
139+
122140
func testShowSpinnerInButtonWithAttributedSting() {
123141
button.isUserInteractionEnabled = true
124142

0 commit comments

Comments
 (0)