summaryrefslogtreecommitdiff
path: root/HutchTests/SettingsViewTests.swift
blob: f0f7fc14579f06ce2498a34a7a6b0421686770aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import Foundation
import Testing
@testable import Hutch

@MainActor
struct SettingsViewTests {

    @Test
    @MainActor
    func settingsBioAttributedStringPreservesInlineMarkdown() {
        let attributed = settingsBioAttributedString("Hello **world** and [link](https://example.com)")

        #expect(String(attributed.characters).contains("Hello world and link"))
    }

    @Test
    @MainActor
    func settingsBioAttributedStringFallsBackForInvalidMarkdown() {
        let attributed = settingsBioAttributedString("[broken")

        #expect(String(attributed.characters) == "[broken")
    }
}