File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1158,6 +1158,24 @@ func TestUpdateUserPassword(t *testing.T) {
1158
1158
require .Equal (t , database .AuditActionWrite , auditor .AuditLogs ()[numLogs - 1 ].Action )
1159
1159
})
1160
1160
1161
+ t .Run ("ValidateUserPassword" , func (t * testing.T ) {
1162
+ t .Parallel ()
1163
+ auditor := audit .NewMock ()
1164
+ client := coderdtest .New (t , & coderdtest.Options {Auditor : auditor })
1165
+
1166
+ _ = coderdtest .CreateFirstUser (t , client )
1167
+
1168
+ ctx , cancel := context .WithTimeout (context .Background (), testutil .WaitLong )
1169
+ defer cancel ()
1170
+
1171
+ resp , err := client .ValidateUserPassword (ctx , codersdk.ValidateUserPasswordRequest {
1172
+ Password : "MySecurePassword!" ,
1173
+ })
1174
+
1175
+ require .NoError (t , err , "users shoud be able to validate complexity of a potential new password" )
1176
+ require .True (t , resp .Valid )
1177
+ })
1178
+
1161
1179
t .Run ("ChangingPasswordDeletesKeys" , func (t * testing.T ) {
1162
1180
t .Parallel ()
1163
1181
You can’t perform that action at this time.
0 commit comments