Skip to content

Commit

Permalink
Fix failing tests on tvOS
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsaidi committed Jan 12, 2024
1 parent a21050c commit f79ae49
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<key>Demo (macOS).xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
<integer>1</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ final class RichTextViewComponent_FontSizeTests: XCTestCase {
XCTAssertEqual(textView.currentFontSize, size)
assertEqualFontSize(textView.currentRichTextAttribute(.font))
assertEqualFontSize(textView.richTextAttributes(at: selectedRange)[.font])
assertEqualFontSize(textView.typingAttributes[.font])
assertEqualFontSize(textView.typingAttributes[.font], expected: nil)
}

func testCurrentFontSizeWorksForNoSelectedRange() {
Expand All @@ -93,8 +93,8 @@ private extension RichTextViewComponent_FontSizeTests {
XCTAssertEqual(attr as? FontRepresentable, font)
}

func assertEqualFontSize(_ attr: Any?) {
XCTAssertEqual((attr as? FontRepresentable)?.pointSize, size)
func assertEqualFontSize(_ attr: Any?, expected: CGFloat? = 666) {
XCTAssertEqual((attr as? FontRepresentable)?.pointSize, expected)
}

func assertNonEqualFont(_ attr: Any?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ final class RichTextViewComponentTests: XCTestCase {
XCTAssertEqual(view.contentCompressionResistancePriority(for: .horizontal), .defaultLow)
#if iOS || os(tvOS)
XCTAssertEqual(view.spellCheckingType, .no)
XCTAssertEqual(view.textColor, nil)
XCTAssertEqual(view.textColor, .label)
#elseif os(macOS)
XCTAssertEqual(view.textColor, nil)
#endif
Expand Down

0 comments on commit f79ae49

Please sign in to comment.