Fix tests

This commit is contained in:
Shawn Gong
2020-02-17 19:18:21 -08:00
parent 8c76d5af4c
commit 378e60fcf2
3 changed files with 13 additions and 11 deletions
+2 -2
View File
@@ -1,3 +1,3 @@
github "Quick/Nimble" "v8.0.1"
github "Quick/Quick" "v2.0.0"
github "Quick/Nimble" "v8.0.5"
github "Quick/Quick" "v2.2.0"
github "nathantannar4/InputBarAccessoryView" "4.3.0"
@@ -71,7 +71,7 @@ class MessagesDisplayDelegateTests: XCTestCase {
at: IndexPath(item: 0, section: 0),
in: sut.messagesCollectionView)
XCTAssertEqual(backgroundColor, .white)
XCTAssertEqual(backgroundColor, .backgroundColor)
}
func testBackgroundColorForMessageWithEmoji_returnsClearForDefault() {
@@ -143,7 +143,7 @@ class TextMessageDisplayDelegateTests: XCTestCase {
at: IndexPath(item: 0, section: 0),
in: sut.messagesCollectionView)
XCTAssertEqual(textColor, .white)
XCTAssertEqual(textColor, .backgroundColor)
}
func testTextColorFromYou_returnsDarkTextForDefault() {
@@ -151,7 +151,7 @@ class TextMessageDisplayDelegateTests: XCTestCase {
at: IndexPath(item: 0, section: 0),
in: sut.messagesCollectionView)
XCTAssertEqual(textColor, .darkText)
XCTAssertEqual(textColor, .labelColor)
}
func testTextColorWithoutDataSource_returnsDarkTextForDefault() {
@@ -161,7 +161,7 @@ class TextMessageDisplayDelegateTests: XCTestCase {
at: IndexPath(item: 0, section: 0),
in: sut.messagesCollectionView)
XCTAssertEqual(textColor, .darkText)
XCTAssertEqual(textColor, .labelColor)
}
func testEnableDetectors_returnsEmptyForDefault() {
+7 -5
View File
@@ -42,7 +42,9 @@ class AvatarViewTests: XCTestCase {
func testNoParams() {
XCTAssertEqual(avatarView.layer.cornerRadius, 15.0)
XCTAssertEqual(avatarView.backgroundColor, UIColor.gray)
// For certain dynamic colors, need to compare cgColor in XCTest
// https://stackoverflow.com/questions/58065340/how-to-compare-two-uidynamicprovidercolor
XCTAssertEqual(avatarView.backgroundColor!.cgColor, UIColor.grayColor.cgColor)
}
func testWithImage() {
@@ -50,7 +52,7 @@ class AvatarViewTests: XCTestCase {
avatarView.set(avatar: avatar)
XCTAssertEqual(avatar.initials, "?")
XCTAssertEqual(avatarView.layer.cornerRadius, 15.0)
XCTAssertEqual(avatarView.backgroundColor, UIColor.gray)
XCTAssertEqual(avatarView.backgroundColor!.cgColor, UIColor.grayColor.cgColor)
}
func testInitialsOnly() {
@@ -59,13 +61,13 @@ class AvatarViewTests: XCTestCase {
XCTAssertEqual(avatarView.initials, avatar.initials)
XCTAssertEqual(avatar.initials, "DL")
XCTAssertEqual(avatarView.layer.cornerRadius, 15.0)
XCTAssertEqual(avatarView.backgroundColor, UIColor.gray)
XCTAssertEqual(avatarView.backgroundColor!.cgColor, UIColor.grayColor.cgColor)
}
func testSetBackground() {
XCTAssertEqual(avatarView.backgroundColor, UIColor.gray)
XCTAssertEqual(avatarView.backgroundColor!.cgColor, UIColor.grayColor.cgColor)
avatarView.backgroundColor = UIColor.red
XCTAssertEqual(avatarView.backgroundColor, UIColor.red)
XCTAssertEqual(avatarView.backgroundColor!, UIColor.red)
}
func testGetImage() {