DayByDayTests/HeadingFontTests.swift
21 lines · 689 bytes
3 symbols in this file
1import SwiftUI
2import Testing
3import UIKit
4@testable import DayByDay
5
6@MainActor
7struct HeadingFontTests {
8 @Test func balooIsBundledAndRegistered() {
9 HeadingFont.register()
10 #expect(UIFont(name: HeadingFont.bold, size: 20) != nil)
11 #expect(UIFont(name: HeadingFont.extraBold, size: 20) != nil)
12 }
13
14 @Test func headingsScaleLikeTheNearestTextStyle() {
15 #expect(HeadingFont.textStyle(for: 11) == .caption2)
16 #expect(HeadingFont.textStyle(for: 17) == .body)
17 #expect(HeadingFont.textStyle(for: 22) == .title2)
18 #expect(HeadingFont.textStyle(for: 28) == .title)
19 #expect(HeadingFont.textStyle(for: 96) == .largeTitle)
20 }
21}