Add template to xcodegen, fix build and tests

This commit is contained in:
Stefan Ceriu
2022-05-12 12:30:24 +03:00
committed by Stefan Ceriu
parent 4b728f3d09
commit 2f6015b97b
15 changed files with 240 additions and 77 deletions
@@ -38,7 +38,6 @@ final class RoomScreenCoordinator: Coordinator, Presentable {
// MARK: - Setup
@available(iOS 14.0, *)
init(parameters: RoomScreenCoordinatorParameters) {
self.parameters = parameters
@@ -63,7 +63,6 @@ struct MessageComposerTextField: View {
}
}
@available(iOS 14.0, *)
private struct UITextViewWrapper: UIViewRepresentable {
typealias UIViewType = UITextView
+6 -4
View File
@@ -21,7 +21,7 @@ class UITestsAppCoordinator: Coordinator {
window.rootViewController = mainNavigationController
let screens = mockScreens()
let rootView = UITestsRootView(mockCoordinators: screens) { id in
let rootView = UITestsRootView(mockScreens: screens) { id in
guard let screen = screens.filter({ $0.id == id }).first else {
fatalError()
}
@@ -36,12 +36,14 @@ class UITestsAppCoordinator: Coordinator {
window.makeKeyAndVisible()
}
private func mockScreens() -> [MockScreens] {
[MockScreens(id: "Login screen", coordinator: LoginScreenCoordinator(parameters: .init()))]
private func mockScreens() -> [MockScreen] {
[MockScreen(id: "Login screen", coordinator: LoginScreenCoordinator(parameters: .init())),
MockScreen(id: "Simple Screen - Regular", coordinator: TemplateSimpleScreenCoordinator(parameters: .init(promptType: .regular))),
MockScreen(id: "Simple Screen - Upgrade", coordinator: TemplateSimpleScreenCoordinator(parameters: .init(promptType: .upgrade)))]
}
}
struct MockScreens: Identifiable {
struct MockScreen: Identifiable {
let id: String
let coordinator: Presentable
}
+2 -2
View File
@@ -10,12 +10,12 @@ import SwiftUI
struct UITestsRootView: View {
let mockCoordinators: [MockScreens]
let mockScreens: [MockScreen]
var selectionCallback: ((String) -> Void)?
var body: some View {
NavigationView {
List(mockCoordinators) { coordinator in
List(mockScreens) { coordinator in
Button(coordinator.id) {
selectionCallback?(coordinator.id)
}
+1
View File
@@ -88,3 +88,4 @@ targets:
- Screens/Templates
- path: ../Resources
- path: ../SupportingFiles
- path: ../../Tools/Scripts/Templates/SimpleScreenExample/ElementX