Skip to content

Commit 464d95e

Browse files
Add previews to integration test cases (#2551)
* Add previews to all integration tests. * wip; * wip * wip * debug * xcode 15 * split out examples * wip * wip * move around tests so they don't go off screen * wip * wip * ops * wip * wip --------- Co-authored-by: Stephen Celis <[email protected]>
1 parent 4f9df4d commit 464d95e

31 files changed

+420
-176
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ jobs:
2525
- release
2626
steps:
2727
- uses: actions/checkout@v4
28-
- name: Select Xcode 14.3
29-
run: sudo xcode-select -s /Applications/Xcode_14.3.app
28+
- name: Select Xcode 15
29+
run: sudo xcode-select -s /Applications/Xcode_15.0.1.app
3030
- name: Run ${{ matrix.config }} tests
3131
run: make CONFIG=${{ matrix.config }} test-library
3232

@@ -35,8 +35,8 @@ jobs:
3535
runs-on: macos-13
3636
steps:
3737
- uses: actions/checkout@v4
38-
- name: Select Xcode 14.3
39-
run: sudo xcode-select -s /Applications/Xcode_14.3.app
38+
- name: Select Xcode 15
39+
run: sudo xcode-select -s /Applications/Xcode_15.0.1.app
4040
- name: Build for library evolution
4141
run: make build-for-library-evolution
4242

@@ -45,8 +45,8 @@ jobs:
4545
runs-on: macos-13
4646
steps:
4747
- uses: actions/checkout@v4
48-
- name: Select Xcode 14.3
49-
run: sudo xcode-select -s /Applications/Xcode_14.3.app
48+
- name: Select Xcode 15
49+
run: sudo xcode-select -s /Applications/Xcode_15.0.1.app
5050
- name: Run benchmark
5151
run: make benchmark
5252

@@ -55,7 +55,17 @@ jobs:
5555
runs-on: macos-13
5656
steps:
5757
- uses: actions/checkout@v4
58-
- name: Select Xcode 14.3
59-
run: sudo xcode-select -s /Applications/Xcode_14.3.app
58+
- name: Select Xcode 15
59+
run: sudo xcode-select -s /Applications/Xcode_15.0.1.app
6060
- name: Run tests
6161
run: make test-examples
62+
63+
integration:
64+
name: Integration
65+
runs-on: macos-13
66+
steps:
67+
- uses: actions/checkout@v4
68+
- name: Select Xcode 15
69+
run: sudo xcode-select -s /Applications/Xcode_15.0.1.app
70+
- name: Run tests
71+
run: make test-integration

Examples/Integration/Integration.xcodeproj/project.pbxproj

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
CA487B2C2A15185300F54A79 /* BaseIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA487B2B2A15185300F54A79 /* BaseIntegrationTests.swift */; };
1212
CA4BA5E929E76A7F0004FF9D /* NavigationStackTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA4BA5E829E76A7F0004FF9D /* NavigationStackTestCase.swift */; };
1313
CA4BA5EB29E76F110004FF9D /* LegacyNavigationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA4BA5EA29E76F110004FF9D /* LegacyNavigationTests.swift */; };
14-
CA595273296DF46D00B5B695 /* NavigationStackBindingTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA595272296DF46D00B5B695 /* NavigationStackBindingTestCase.swift */; };
15-
CA595275296DF55A00B5B695 /* NavigationStackBindingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA595274296DF55A00B5B695 /* NavigationStackBindingTests.swift */; };
1614
CA595278296DF67E00B5B695 /* ComposableArchitecture in Frameworks */ = {isa = PBXBuildFile; productRef = CA595277296DF67E00B5B695 /* ComposableArchitecture */; };
1715
CA8B2E9A2AC576CA008272E0 /* BasicsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA8B2E962AC576B5008272E0 /* BasicsTests.swift */; };
1816
CA8B2E9B2AC576CA008272E0 /* EnumTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA8B2E942AC576B5008272E0 /* EnumTests.swift */; };
@@ -97,8 +95,6 @@
9795
CA487B2B2A15185300F54A79 /* BaseIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseIntegrationTests.swift; sourceTree = "<group>"; };
9896
CA4BA5E829E76A7F0004FF9D /* NavigationStackTestCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationStackTestCase.swift; sourceTree = "<group>"; };
9997
CA4BA5EA29E76F110004FF9D /* LegacyNavigationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegacyNavigationTests.swift; sourceTree = "<group>"; };
100-
CA595272296DF46D00B5B695 /* NavigationStackBindingTestCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationStackBindingTestCase.swift; sourceTree = "<group>"; };
101-
CA595274296DF55A00B5B695 /* NavigationStackBindingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationStackBindingTests.swift; sourceTree = "<group>"; };
10298
CA595276296DF66B00B5B695 /* swift-composable-architecture */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "swift-composable-architecture"; path = ../..; sourceTree = "<group>"; };
10399
CA8B2E942AC576B5008272E0 /* EnumTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EnumTests.swift; sourceTree = "<group>"; };
104100
CA8B2E952AC576B5008272E0 /* OptionalTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OptionalTests.swift; sourceTree = "<group>"; };
@@ -183,7 +179,6 @@
183179
E9919D41296E47A400C8716B /* BindingsAnimationsTestBench.swift */,
184180
E9919D3D296E28C800C8716B /* EscapedWithViewStoreTestCase.swift */,
185181
CAA1CB1E296DEEAC000665B1 /* ForEachBindingTestCase.swift */,
186-
CA595272296DF46D00B5B695 /* NavigationStackBindingTestCase.swift */,
187182
CA4BA5E829E76A7F0004FF9D /* NavigationStackTestCase.swift */,
188183
DC92799A2A1E59D500B2031A /* PresentationItemTestCase.swift */,
189184
CAF5802429A5651D0042FB62 /* LegacyPresentationTestCase.swift */,
@@ -198,7 +193,6 @@
198193
DCFFB8E82A15792C006AF839 /* BindingLocalTests.swift */,
199194
E9919D3F296E3EF400C8716B /* EscapedWithViewStoreTests.swift */,
200195
CAA1CB0F296DEE79000665B1 /* ForEachBindingTests.swift */,
201-
CA595274296DF55A00B5B695 /* NavigationStackBindingTests.swift */,
202196
CA4BA5EA29E76F110004FF9D /* LegacyNavigationTests.swift */,
203197
CAF5802629A567BB0042FB62 /* LegacyPresentationTests.swift */,
204198
DC140CC629E0E8F3006DF553 /* SwitchStoreTests.swift */,
@@ -452,7 +446,6 @@
452446
CA4BA5E929E76A7F0004FF9D /* NavigationStackTestCase.swift in Sources */,
453447
E9919D42296E47A400C8716B /* BindingsAnimationsTestBench.swift in Sources */,
454448
DCFFB8E72A156488006AF839 /* BindingLocalTestCase.swift in Sources */,
455-
CA595273296DF46D00B5B695 /* NavigationStackBindingTestCase.swift in Sources */,
456449
CAF5802529A5651D0042FB62 /* LegacyPresentationTestCase.swift in Sources */,
457450
CA8B2EB22AC5AD63008272E0 /* NavigationTestCase.swift in Sources */,
458451
E9919D3E296E28C800C8716B /* EscapedWithViewStoreTestCase.swift in Sources */,
@@ -478,7 +471,6 @@
478471
CAF5802729A567BB0042FB62 /* LegacyPresentationTests.swift in Sources */,
479472
CA487B2C2A15185300F54A79 /* BaseIntegrationTests.swift in Sources */,
480473
CA8B2EA72AC584BE008272E0 /* SiblingTests.swift in Sources */,
481-
CA595275296DF55A00B5B695 /* NavigationStackBindingTests.swift in Sources */,
482474
CAA1CB10296DEE79000665B1 /* ForEachBindingTests.swift in Sources */,
483475
DCFFB8E92A15792C006AF839 /* BindingLocalTests.swift in Sources */,
484476
CA8B2E9A2AC576CA008272E0 /* BasicsTests.swift in Sources */,
@@ -570,7 +562,6 @@
570562
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
571563
GCC_WARN_UNUSED_FUNCTION = YES;
572564
GCC_WARN_UNUSED_VARIABLE = YES;
573-
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
574565
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
575566
MTL_FAST_MATH = YES;
576567
ONLY_ACTIVE_ARCH = YES;
@@ -624,7 +615,6 @@
624615
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
625616
GCC_WARN_UNUSED_FUNCTION = YES;
626617
GCC_WARN_UNUSED_VARIABLE = YES;
627-
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
628618
MTL_ENABLE_DEBUG_INFO = NO;
629619
MTL_FAST_MATH = YES;
630620
SDKROOT = iphoneos;

Examples/Integration/Integration/BasicsTestCase.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,10 @@ struct BasicsView: View {
4646
}
4747
}
4848
}
49+
50+
struct BasicsPreviews: PreviewProvider {
51+
static var previews: some View {
52+
let _ = Logger.shared.isEnabled = true
53+
BasicsView()
54+
}
55+
}

Examples/Integration/Integration/EnumTestCase.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,10 @@ struct EnumTestCase_Previews: PreviewProvider {
147147
EnumView()
148148
}
149149
}
150+
151+
struct EnumPreviews: PreviewProvider {
152+
static var previews: some View {
153+
let _ = Logger.shared.isEnabled = true
154+
EnumView()
155+
}
156+
}

Examples/Integration/Integration/IdentifiedListTestCase.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,12 @@ struct IdentifiedListView: View {
8989
}
9090
}
9191
}
92+
93+
struct IdentifiedListPreviews: PreviewProvider {
94+
static var previews: some View {
95+
let _ = Logger.shared.isEnabled = true
96+
NavigationStack {
97+
IdentifiedListView()
98+
}
99+
}
100+
}

Examples/Integration/Integration/IntegrationApp.swift

Lines changed: 72 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -72,99 +72,95 @@ struct IntegrationApp: App {
7272
struct ContentView: View {
7373
@State var isBindingLocalTestCasePresented = false
7474
@State var isNavigationStackTestCasePresented = false
75-
@State var isNavigationStackBindingTestCasePresented = false
7675
@State var isNavigationTestCasePresented = false
7776

7877
var body: some View {
7978
NavigationStack {
8079
List {
81-
Section {
82-
NavigationLink("Basics") {
83-
Form {
84-
BasicsView()
85-
}
86-
}
87-
NavigationLink("Enum") {
88-
EnumView()
89-
}
90-
NavigationLink("Optional") {
91-
OptionalView()
92-
}
93-
NavigationLink("Identified list") {
94-
IdentifiedListView()
95-
}
96-
Button("Navigation") {
97-
self.isNavigationTestCasePresented = true
98-
}
99-
.sheet(isPresented: self.$isNavigationTestCasePresented) {
100-
NavigationTestCaseView()
101-
}
102-
NavigationLink("Siblings") {
103-
SiblingFeaturesView()
104-
}
105-
NavigationLink("Presentation") {
106-
PresentationView()
107-
}
108-
}
109-
110-
Section {
111-
ForEach(TestCase.allCases) { test in
112-
switch test {
113-
case .escapedWithViewStore:
114-
NavigationLink(test.rawValue) {
115-
EscapedWithViewStoreTestCaseView()
116-
}
117-
118-
case .forEachBinding:
119-
NavigationLink(test.rawValue) {
120-
ForEachBindingTestCaseView()
80+
NavigationLink("iOS 16") {
81+
List {
82+
Section {
83+
NavigationLink("Basics") {
84+
Form {
85+
BasicsView()
86+
}
12187
}
122-
123-
case .navigationStack:
124-
Button(test.rawValue) {
125-
self.isNavigationStackTestCasePresented = true
88+
NavigationLink("Enum") {
89+
EnumView()
12690
}
127-
.foregroundColor(.black)
128-
.sheet(isPresented: self.$isNavigationStackTestCasePresented) {
129-
NavigationStackTestCaseView()
91+
NavigationLink("Optional") {
92+
OptionalView()
13093
}
131-
132-
case .navigationStackBinding:
133-
Button(test.rawValue) {
134-
self.isNavigationStackBindingTestCasePresented = true
94+
NavigationLink("Identified list") {
95+
IdentifiedListView()
13596
}
136-
.foregroundColor(.black)
137-
.sheet(isPresented: self.$isNavigationStackBindingTestCasePresented) {
138-
NavigationStackBindingTestCaseView()
97+
Button("Navigation") {
98+
self.isNavigationTestCasePresented = true
13999
}
140-
141-
case .presentation:
142-
NavigationLink(test.rawValue) {
143-
PresentationTestCaseView()
100+
.sheet(isPresented: self.$isNavigationTestCasePresented) {
101+
NavigationTestCaseView()
144102
}
145-
146-
case .presentationItem:
147-
NavigationLink(test.rawValue) {
148-
PresentationItemTestCaseView()
103+
NavigationLink("Siblings") {
104+
SiblingFeaturesView()
149105
}
150-
151-
case .switchStore:
152-
NavigationLink(test.rawValue) {
153-
SwitchStoreTestCaseView()
106+
NavigationLink("Presentation") {
107+
PresentationView()
154108
}
109+
}
110+
}
111+
.navigationTitle(Text("iOS 16"))
112+
}
155113

156-
case .bindingLocal:
157-
Button(test.rawValue) {
158-
self.isBindingLocalTestCasePresented = true
159-
}
160-
.foregroundColor(.black)
161-
.sheet(isPresented: self.$isBindingLocalTestCasePresented) {
162-
BindingLocalTestCaseView()
114+
NavigationLink("Legacy") {
115+
List {
116+
ForEach(TestCase.allCases) { test in
117+
switch test {
118+
case .escapedWithViewStore:
119+
NavigationLink(test.rawValue) {
120+
EscapedWithViewStoreTestCaseView()
121+
}
122+
123+
case .forEachBinding:
124+
NavigationLink(test.rawValue) {
125+
ForEachBindingTestCaseView()
126+
}
127+
128+
case .navigationStack:
129+
Button(test.rawValue) {
130+
self.isNavigationStackTestCasePresented = true
131+
}
132+
.foregroundColor(.black)
133+
.sheet(isPresented: self.$isNavigationStackTestCasePresented) {
134+
NavigationStackTestCaseView()
135+
}
136+
137+
case .presentation:
138+
NavigationLink(test.rawValue) {
139+
PresentationTestCaseView()
140+
}
141+
142+
case .presentationItem:
143+
NavigationLink(test.rawValue) {
144+
PresentationItemTestCaseView()
145+
}
146+
147+
case .switchStore:
148+
NavigationLink(test.rawValue) {
149+
SwitchStoreTestCaseView()
150+
}
151+
152+
case .bindingLocal:
153+
Button(test.rawValue) {
154+
self.isBindingLocalTestCasePresented = true
155+
}
156+
.foregroundColor(.black)
157+
.sheet(isPresented: self.$isBindingLocalTestCasePresented) {
158+
BindingLocalTestCaseView()
159+
}
163160
}
164161
}
165162
}
166-
} header: {
167-
Text("Legacy")
163+
.navigationTitle(Text("Legacy"))
168164
}
169165

170166
Section {

Examples/Integration/Integration/Legacy/NavigationStackBindingTestCase.swift

Lines changed: 0 additions & 52 deletions
This file was deleted.

Examples/Integration/Integration/NavigationTestCase.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,10 @@ struct NavigationTestCaseView: View {
4242
}
4343
}
4444
}
45+
46+
struct NavigationPreviews: PreviewProvider {
47+
static var previews: some View {
48+
let _ = Logger.shared.isEnabled = true
49+
NavigationTestCaseView()
50+
}
51+
}

0 commit comments

Comments
 (0)