Skip to content

Commit

Permalink
Added test for web colors.
Browse files Browse the repository at this point in the history
  • Loading branch information
nbasham committed Feb 1, 2021
1 parent 8276ab9 commit b6666ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/BlackLabsSwiftUIColor/BlackLabsSwiftUIColor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public extension UIColor {
return cssName
}

fileprivate static let cssToHexDictionairy: [String: String] = [
internal static let cssToHexDictionairy: [String: String] = [
"CLEAR": "00000000",
"TRANSPARENT": "00000000",
"": "00000000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ final class BlackLabsSwiftUIColorTests: XCTestCase {
}

XCTAssertNotNil(Color.random)

for (name, hex) in UIColor.cssToHexDictionairy {
XCTAssertNotNil(Color(hex: hex), "Unable to resolve color for web color: '\(name)'.")
}
}

static var allTests = [
Expand Down

0 comments on commit b6666ed

Please sign in to comment.