File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ //
2
+ // File.swift
3
+ //
4
+ //
5
+ // Created by Carson Katri on 1/17/23.
6
+ //
7
+
8
+ import XCTest
9
+ import SwiftUI
10
+ @testable import LiveViewNative
11
+
12
+ @MainActor
13
+ final class LinkTests : XCTestCase {
14
+ func testSimple( ) throws {
15
+ try assertMatch ( #"<lvn-link destination="https://apple.com">Hello, world!</lvn-link>"# ) {
16
+ Link ( " Hello, world! " , destination: URL ( string: " https://apple.com " ) !)
17
+ }
18
+ }
19
+
20
+ func testComplexBody( ) throws {
21
+ try assertMatch ( #"""
22
+ <lvn-link destination="https://apple.com">
23
+ <hstack>
24
+ <image system-name="link" />
25
+ <text>Click the link</text>
26
+ </hstack>
27
+ </lvn-link>
28
+ """# ) {
29
+ Link ( destination: URL ( string: " https://apple.com " ) !) {
30
+ HStack {
31
+ Image ( systemName: " link " )
32
+ Text ( " Click the link " )
33
+ }
34
+ }
35
+ }
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments