@@ -32,6 +32,21 @@ struct VPNMenuTests {
32
32
}
33
33
}
34
34
35
+ @Test
36
+ func testVPNLoggedOutUnconfigured( ) async throws {
37
+ vpn. state = . failed( . networkExtensionError( . unconfigured) )
38
+ try await ViewHosting . host ( view) {
39
+ try await sut. inspection. inspect { view in
40
+ let toggle = try view. find ( ViewType . Toggle. self)
41
+ // Toggle should be enabled even with a failure that would
42
+ // normally make it disabled, because we're signed out.
43
+ #expect( !toggle. isDisabled ( ) )
44
+ #expect( throws: Never . self) { try view. find ( text: " Sign in to use Coder Desktop " ) }
45
+ #expect( throws: Never . self) { try view. find ( button: " Sign in " ) }
46
+ }
47
+ }
48
+ }
49
+
35
50
@Test
36
51
func testStartStopCalled( ) async throws {
37
52
try await ViewHosting . host ( view) {
@@ -59,6 +74,7 @@ struct VPNMenuTests {
59
74
@Test
60
75
func testVPNDisabledWhileConnecting( ) async throws {
61
76
vpn. state = . disabled
77
+ state. login ( baseAccessURL: URL ( string: " https://coder.example.com " ) !, sessionToken: " fake-token " )
62
78
63
79
try await ViewHosting . host ( view) {
64
80
try await sut. inspection. inspect { view in
@@ -79,6 +95,7 @@ struct VPNMenuTests {
79
95
@Test
80
96
func testVPNDisabledWhileDisconnecting( ) async throws {
81
97
vpn. state = . disabled
98
+ state. login ( baseAccessURL: URL ( string: " https://coder.example.com " ) !, sessionToken: " fake-token " )
82
99
83
100
try await ViewHosting . host ( view) {
84
101
try await sut. inspection. inspect { view in
0 commit comments