@@ -18,31 +18,31 @@ struct LiteralHeadersSettingTests {
1818 view = sut. environmentObject ( vpn) . environmentObject ( Settings ( store: store) )
1919 }
2020
21- // @Test
22- // func testToggleDisabledWhenVPNEnabled() async throws {
23- // vpn.state = .connected
24- //
25- // try await ViewHosting.host(view) {
26- // try await sut.inspection.inspect { view in
27- // let toggle = try view.find(ViewType.Toggle.self)
28- // #expect(toggle.isDisabled())
29- // #expect(throws: Never.self) { try toggle.labelView().find(text: "HTTP Headers") }
30- // }
31- // }
32- // }
33- //
34- // @Test
35- // func testToggleEnabledWhenVPNDisabled() async throws {
36- // vpn.state = .disabled
37- //
38- // try await ViewHosting.host(view) {
39- // try await sut.inspection.inspect { view in
40- // let toggle = try view.find(ViewType.Toggle.self)
41- // #expect(!toggle.isDisabled())
42- // #expect(throws: Never.self) { try toggle.labelView().find(text: "HTTP Headers") }
43- // }
44- // }
45- // }
21+ @Test
22+ func testToggleDisabledWhenVPNEnabled( ) async throws {
23+ vpn. state = . connected
24+
25+ try await ViewHosting . host ( view) {
26+ try await sut. inspection. inspect { view in
27+ let toggle = try view. find ( ViewType . Toggle. self)
28+ #expect( toggle. isDisabled ( ) )
29+ #expect( throws: Never . self) { try toggle. labelView ( ) . find ( text: " HTTP Headers " ) }
30+ }
31+ }
32+ }
33+
34+ @Test
35+ func testToggleEnabledWhenVPNDisabled( ) async throws {
36+ vpn. state = . disabled
37+
38+ try await ViewHosting . host ( view) {
39+ try await sut. inspection. inspect { view in
40+ let toggle = try view. find ( ViewType . Toggle. self)
41+ #expect( !toggle. isDisabled ( ) )
42+ #expect( throws: Never . self) { try toggle. labelView ( ) . find ( text: " HTTP Headers " ) }
43+ }
44+ }
45+ }
4646
4747 // TODO: More tests, ViewInspector cannot currently inspect Tables
4848}
0 commit comments