File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
Example/OpenSwiftUIUITests/View/LabeledContent Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ //
2+ // LabeledContentUITests.swift
3+ // OpenSwiftUIUITests
4+
5+ import Testing
6+ import SnapshotTesting
7+
8+ @MainActor
9+ @Suite ( . snapshots( record: . never, diffTool: diffTool) )
10+ struct LabeledContentUITests {
11+ @Test
12+ func defaultStyle( ) {
13+ struct ContentView : View {
14+ var body : some View {
15+ LabeledContent {
16+ Color . red
17+ } label: {
18+ Color . blue
19+ }
20+
21+ }
22+ }
23+ openSwiftUIAssertSnapshot ( of: ContentView ( ) )
24+ }
25+
26+ @Test
27+ func customStyle( ) {
28+ struct CustomStyle : LabeledContentStyle {
29+ func makeBody( configuration: Configuration ) -> some View {
30+ VStack ( spacing: 0 ) {
31+ configuration. label
32+ configuration. content
33+ }
34+ }
35+ }
36+ struct ContentView : View {
37+ var body : some View {
38+ LabeledContent {
39+ Color . red
40+ } label: {
41+ Color . blue
42+ } . labeledContentStyle ( CustomStyle ( ) )
43+ }
44+ }
45+ openSwiftUIAssertSnapshot ( of: ContentView ( ) )
46+ }
47+ }
You can’t perform that action at this time.
0 commit comments