restores Helder in all its glory
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import AppKit
|
||||
import HelderUI
|
||||
import Testing
|
||||
|
||||
@Suite struct FontRegistryTests {
|
||||
@Test func bundledPlexFacesRegister() {
|
||||
let names = FontRegistry.registerBundledFonts()
|
||||
for face in PlexFace.allCases {
|
||||
#expect(names.contains(face.rawValue), "missing \(face.rawValue)")
|
||||
#expect(NSFont(name: face.rawValue, size: 12) != nil)
|
||||
}
|
||||
}
|
||||
|
||||
@Test func typeRolesResolveToPlex() {
|
||||
FontRegistry.registerBundledFonts()
|
||||
#expect(Typography.code.nsFont.fontName == "IBMPlexMono-Regular")
|
||||
#expect(Typography.row.nsFont.fontName == "IBMPlexSans-Regular")
|
||||
}
|
||||
}
|
||||
|
||||
@Suite struct CommitLabelTests {
|
||||
@Test func theCommitLabelIsPlexSansSemiBold() {
|
||||
FontRegistry.registerBundledFonts()
|
||||
#expect(Typography.commitButton.nsFont.fontName == "IBMPlexSans-SemiBold")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import AppKit
|
||||
import HelderUI
|
||||
import Testing
|
||||
|
||||
@Suite struct PaletteTests {
|
||||
@Test func parsesTheConfigColourFormats() throws {
|
||||
let hex = try #require(NSColor(css: "#E8913A"))
|
||||
#expect(abs(hex.redComponent - 232.0 / 255) < 0.001)
|
||||
let rgba = try #require(NSColor(css: "rgba(232,145,58,0.22)"))
|
||||
#expect(abs(rgba.alphaComponent - 0.22) < 0.001)
|
||||
#expect(NSColor(css: "teal") == nil)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user