HutchTests/SettingsViewTests.swift

63dd5cadae5e3867fbfb6f5d9923f00484728a6b
hutch/HutchTests/SettingsViewTests.swift history · blame · raw

22 lines · 592 bytes

 1import Foundation
 2import Testing
 3@testable import Hutch
 4
 5struct SettingsViewTests {
 6
 7    @Test
 8    @MainActor
 9    func settingsBioAttributedStringPreservesInlineMarkdown() {
10        let attributed = settingsBioAttributedString("Hello **world** and [link](https://example.com)")
11
12        #expect(String(attributed.characters).contains("Hello world and link"))
13    }
14
15    @Test
16    @MainActor
17    func settingsBioAttributedStringFallsBackForInvalidMarkdown() {
18        let attributed = settingsBioAttributedString("[broken")
19
20        #expect(String(attributed.characters) == "[broken")
21    }
22}