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

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")
    }
}