Skip to content

Commit 4e5ea3f

Browse files
Add @mockable(superclass: UIViewController) to Flow.stencil for Mockolo 2.6.1
Apply the same fix from Interface.stencil to Flow.stencil, where ViewControllable protocols are generated for view-owning nodes (e.g. Root). Made-with: Cursor
1 parent 1282e82 commit 4e5ea3f

22 files changed

Lines changed: 25 additions & 21 deletions

Sources/NodesGenerator/Resources/Stencils/Flow.stencil

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ internal protocol {{ node_name }}ContextInterface: Context {}
2424
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
2525
/// presentation or containment as desired.
2626
{% if not view_controllable_mock_contents %}
27+
{% if view_controllable_type == "ViewControllable" %}
28+
/// @mockable(superclass: UIViewController)
29+
{% else %}
2730
/// @mockable
2831
{% endif %}
32+
{% endif %}
2933
@MainActor
3034
internal protocol {{ node_name }}ViewControllable: {{ view_controllable_type }} {}
3135
{% endif %}

Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateRootPreset.Contents-RootFlow-swift.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ internal protocol RootContextInterface: Context {}
1313
/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
1414
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
1515
/// presentation or containment as desired.
16-
/// @mockable
16+
/// @mockable(superclass: UIViewController)
1717
@MainActor
1818
internal protocol RootViewControllable: ViewControllable {}
1919

Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKit-Flow.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ internal protocol ___VARIABLE_productName___ContextInterface: Context {}
1111
/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
1212
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
1313
/// presentation or containment as desired.
14-
/// @mockable
14+
/// @mockable(superclass: UIViewController)
1515
@MainActor
1616
internal protocol ___VARIABLE_productName___ViewControllable: ViewControllable {}
1717

Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitCreatedForPluginList-Flow.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ internal protocol ___VARIABLE_productName___ContextInterface: Context {}
1111
/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
1212
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
1313
/// presentation or containment as desired.
14-
/// @mockable
14+
/// @mockable(superclass: UIViewController)
1515
@MainActor
1616
internal protocol ___VARIABLE_productName___ViewControllable: ViewControllable {}
1717

Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUI-Flow.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ internal protocol ___VARIABLE_productName___ContextInterface: Context {}
1111
/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
1212
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
1313
/// presentation or containment as desired.
14-
/// @mockable
14+
/// @mockable(superclass: UIViewController)
1515
@MainActor
1616
internal protocol ___VARIABLE_productName___ViewControllable: ViewControllable {}
1717

Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUICreatedForPluginList-Flow.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ internal protocol ___VARIABLE_productName___ContextInterface: Context {}
1111
/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
1212
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
1313
/// presentation or containment as desired.
14-
/// @mockable
14+
/// @mockable(superclass: UIViewController)
1515
@MainActor
1616
internal protocol ___VARIABLE_productName___ViewControllable: ViewControllable {}
1717

Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-Custom-Flow.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ internal protocol ___VARIABLE_productName___ContextInterface: Context {}
1111
/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
1212
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
1313
/// presentation or containment as desired.
14-
/// @mockable
14+
/// @mockable(superclass: UIViewController)
1515
@MainActor
1616
internal protocol ___VARIABLE_productName___ViewControllable: ViewControllable {}
1717

Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-CustomCreatedForPluginList-Flow.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ internal protocol ___VARIABLE_productName___ContextInterface: Context {}
1111
/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
1212
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
1313
/// presentation or containment as desired.
14-
/// @mockable
14+
/// @mockable(superclass: UIViewController)
1515
@MainActor
1616
internal protocol ___VARIABLE_productName___ViewControllable: ViewControllable {}
1717

Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKit-Flow.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ internal protocol ___VARIABLE_productName___ContextInterface: Context {}
1111
/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
1212
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
1313
/// presentation or containment as desired.
14-
/// @mockable
14+
/// @mockable(superclass: UIViewController)
1515
@MainActor
1616
internal protocol ___VARIABLE_productName___ViewControllable: ViewControllable {}
1717

Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitCreatedForPluginList-Flow.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ internal protocol ___VARIABLE_productName___ContextInterface: Context {}
1111
/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
1212
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
1313
/// presentation or containment as desired.
14-
/// @mockable
14+
/// @mockable(superclass: UIViewController)
1515
@MainActor
1616
internal protocol ___VARIABLE_productName___ViewControllable: ViewControllable {}
1717

0 commit comments

Comments
 (0)