File tree 1 file changed +17
-0
lines changed
Coder Desktop/Coder DesktopTests
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,14 @@ struct LoginTests {
73
73
@Test
74
74
func testFailedAuthentication( ) async throws {
75
75
let url = URL ( string: " https://testFailedAuthentication.com " ) !
76
+ let buildInfo = BuildInfoResponse (
77
+ version: " v2.20.0 "
78
+ )
79
+ try Mock (
80
+ url: url. appendingPathComponent ( " /api/v2/buildinfo " ) ,
81
+ statusCode: 200 ,
82
+ data: [ . get: Client . encoder. encode ( buildInfo) ]
83
+ ) . register ( )
76
84
Mock ( url: url. appendingPathComponent ( " /api/v2/users/me " ) , statusCode: 401 , data: [ . get: Data ( ) ] ) . register ( )
77
85
78
86
try await ViewHosting . host ( view) {
@@ -95,13 +103,22 @@ struct LoginTests {
95
103
id: UUID ( ) ,
96
104
username: " admin "
97
105
)
106
+ let buildInfo = BuildInfoResponse (
107
+ version: " v2.20.0 "
108
+ )
98
109
99
110
try Mock (
100
111
url: url. appendingPathComponent ( " /api/v2/users/me " ) ,
101
112
statusCode: 200 ,
102
113
data: [ . get: Client . encoder. encode ( user) ]
103
114
) . register ( )
104
115
116
+ try Mock (
117
+ url: url. appendingPathComponent ( " /api/v2/buildinfo " ) ,
118
+ statusCode: 200 ,
119
+ data: [ . get: Client . encoder. encode ( buildInfo) ]
120
+ ) . register ( )
121
+
105
122
try await ViewHosting . host ( view) {
106
123
try await sut. inspection. inspect { view in
107
124
try view. find ( ViewType . TextField. self) . setInput ( url. absoluteString)
You can’t perform that action at this time.
0 commit comments