11//
2- // NavigatorTests .swift
2+ // NavigatorCoreTests .swift
33// Navigator
44//
55// Created by zzmasoud on 02/15/25.
@@ -9,7 +9,8 @@ import Testing
99import Foundation
1010@testable import Navigator
1111
12- struct NavigatorTests {
12+ struct NavigatorCoreTests {
13+
1314 // MARK: - Basic Navigation State Tests
1415
1516 @Test func testNavigatorInitialization( ) {
@@ -35,53 +36,6 @@ struct NavigatorTests {
3536 #expect( childNavigator. state. isPresented)
3637 }
3738
38- // MARK: - Navigation Path Management
39-
40- @Test func testNavigationPathOperations( ) async {
41- let navigator = Navigator ( owner: . root)
42- let destination = MockDestination . screen1
43-
44- // Test push
45- await navigator. push ( destination)
46- #expect( navigator. state. path. count == 1 )
47-
48- // Test pop
49- let popped = await navigator. pop ( )
50- #expect( popped)
51- #expect( navigator. state. path. isEmpty)
52- }
53-
54- @Test func testMultiplePathOperations( ) async {
55- let navigator = Navigator ( owner: . root)
56-
57- // Push multiple destinations
58- await navigator. push ( MockDestination . screen1)
59- await navigator. push ( MockDestination . screen2)
60- await navigator. push ( MockDestination . screen3)
61- #expect( navigator. state. path. count == 3 )
62-
63- // Pop to root
64- let popped = await navigator. popAll ( )
65- #expect( popped)
66- #expect( navigator. state. path. isEmpty)
67- }
68-
69- // MARK: - Sheet Presentation Tests
70-
71- @Test func testSheetPresentation( ) async {
72- let navigator = Navigator ( owner: . root)
73- let destination = MockDestination . screen1
74-
75- // Present sheet
76- await navigator. navigate ( to: destination, method: . sheet)
77- #expect( navigator. state. sheet != nil )
78- #expect( navigator. state. sheet? . wrapped as? MockDestination == destination)
79-
80- // Dismiss sheet
81- await navigator. dismissPresentedViews ( )
82- #expect( navigator. state. sheet == nil )
83- }
84-
8539 // MARK: - Navigation Lock Tests
8640
8741 @Test func testNavigationLocking( ) async {
@@ -121,4 +75,5 @@ struct NavigatorTests {
12175 parent. state. removeChild ( child1)
12276 #expect( parent. state. children. count == 1 )
12377 }
78+
12479}
0 commit comments