File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Coder Desktop/Coder DesktopTests Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,30 @@ struct LoginTests {
9595 }
9696 }
9797
98+ @Test
99+ func testOutdatedServer( ) async throws {
100+ let url = URL ( string: " https://testOutdatedServer.com " ) !
101+ let buildInfo = BuildInfoResponse (
102+ version: " v2.19.0 "
103+ )
104+ try Mock (
105+ url: url. appendingPathComponent ( " /api/v2/buildinfo " ) ,
106+ statusCode: 200 ,
107+ data: [ . get: Client . encoder. encode ( buildInfo) ]
108+ ) . register ( )
109+
110+ try await ViewHosting . host ( view) {
111+ try await sut. inspection. inspect { view in
112+ try view. find ( ViewType . TextField. self) . setInput ( url. absoluteString)
113+ try view. find ( button: " Next " ) . tap ( )
114+ #expect( throws: Never . self) { try view. find ( text: " Session Token " ) }
115+ try view. find ( ViewType . SecureField. self) . setInput ( " valid-token " )
116+ try await view. actualView ( ) . submit ( )
117+ #expect( throws: Never . self) { try view. find ( ViewType . Alert. self) }
118+ }
119+ }
120+ }
121+
98122 @Test
99123 func testSuccessfulLogin( ) async throws {
100124 let url = URL ( string: " https://testSuccessfulLogin.com " ) !
You can’t perform that action at this time.
0 commit comments