Skip to content

Commit 9f30263

Browse files
Claudeclaude
andcommitted
Fix all 7 failing UI tests by pre-populating userStatus and adding HasCodespaces flag
Pre-populated userStatus in CatnipInstaller during UI testing mode to ensure button navigation logic works correctly. Also added -HasCodespaces launch argument to test setup methods to match expected mock data scenarios. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 32f41f2 commit 9f30263

16 files changed

+98
-65
lines changed

.github/workflows/test-ios.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
-project xcode/catnip.xcodeproj \
2828
-scheme catnip \
2929
-destination 'platform=iOS Simulator,name=iPhone 16,OS=18.1' \
30-
-only-testing:catnipTests \
30+
-only-testing:CatnipTests \
3131
-enableCodeCoverage YES \
3232
CODE_SIGN_IDENTITY="" \
3333
CODE_SIGNING_REQUIRED=NO
@@ -78,7 +78,7 @@ jobs:
7878
-project xcode/catnip.xcodeproj \
7979
-scheme catnip \
8080
-destination 'platform=iOS Simulator,name=iPhone 16,OS=18.1' \
81-
-only-testing:catnipUITests \
81+
-only-testing:CatnipUITests \
8282
-maximum-concurrent-test-simulator-destinations 4 \
8383
-test-timeouts-enabled YES \
8484
-maximum-test-execution-time-allowance 120 \

xcode/Catnip.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@
729729
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
730730
SWIFT_VERSION = 5.0;
731731
TARGETED_DEVICE_FAMILY = "1,2";
732-
TEST_TARGET_NAME = catnip;
732+
TEST_TARGET_NAME = Catnip;
733733
};
734734
name = Debug;
735735
};
@@ -748,7 +748,7 @@
748748
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
749749
SWIFT_VERSION = 5.0;
750750
TARGETED_DEVICE_FAMILY = "1,2";
751-
TEST_TARGET_NAME = catnip;
751+
TEST_TARGET_NAME = Catnip;
752752
};
753753
name = Release;
754754
};

xcode/catnip/Services/CatnipInstaller.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,13 @@ class CatnipInstaller: ObservableObject {
202202
private init() {
203203
// Load cached repositories on initialization
204204
loadCachedRepositories()
205+
206+
// Pre-populate repositories and user status in UI testing mode
207+
if UITestingHelper.shouldUseMockData {
208+
self.repositories = UITestingHelper.getMockRepositories()
209+
self.userStatus = UITestingHelper.getMockUserStatus()
210+
NSLog("🐱 [CatnipInstaller] Pre-populated \(self.repositories.count) mock repositories and user status during init")
211+
}
205212
}
206213

207214
// MARK: - Computed Properties

xcode/catnipTests/APIModelsTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Testing
99
import Foundation
10-
@testable import catnip
10+
@testable import Catnip
1111

1212
struct APIModelsTests {
1313

xcode/catnipTests/DiffParserTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Testing
99
import Foundation
10-
@testable import catnip
10+
@testable import Catnip
1111

1212
struct DiffParserTests {
1313

xcode/catnipTests/IntegrationTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Testing
99
import Foundation
10-
@testable import catnip
10+
@testable import Catnip
1111

1212
struct IntegrationTests {
1313

xcode/catnipTests/KeychainHelperTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Testing
99
import Foundation
10-
@testable import catnip
10+
@testable import Catnip
1111

1212
struct KeychainHelperTests {
1313

xcode/catnipTests/TestHelpers.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77

88
import Foundation
9-
@testable import catnip
9+
@testable import Catnip
1010

1111
// MARK: - Mock Data Factory
1212

xcode/catnipTests/WorkspaceInfoTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Testing
99
import Foundation
10-
@testable import catnip
10+
@testable import Catnip
1111

1212
struct WorkspaceInfoTests {
1313

xcode/catnipTests/catnipTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77

88
import Testing
9-
@testable import catnip
9+
@testable import Catnip
1010

1111
struct CatnipSmokeTests {
1212

0 commit comments

Comments
 (0)