@@ -479,13 +479,8 @@ func TestAdminViewAllWorkspaces(t *testing.T) {
479
479
func TestWorkspacesSortOrder (t * testing.T ) {
480
480
t .Parallel ()
481
481
482
- ctx ,cancel := context .WithTimeout (context .Background (),testutil .WaitLong )
483
- defer cancel ()
484
-
485
482
client ,db := coderdtest .NewWithDatabase (t ,nil )
486
- firstUser := coderdtest .CreateFirstUser (t ,client ,func (r * codersdk.CreateFirstUserRequest ) {
487
- r .Username = "aaa"
488
- })
483
+ firstUser := coderdtest .CreateFirstUser (t ,client )
489
484
secondUserClient ,secondUser := coderdtest .CreateAnotherUserMutators (t ,client ,firstUser .OrganizationID , []string {"owner" },func (r * codersdk.CreateUserRequest ) {
490
485
r .Username = "zzz"
491
486
})
@@ -507,6 +502,9 @@ func TestWorkspacesSortOrder(t *testing.T) {
507
502
508
503
// f-workspace is also stopped, but is marked as favorite
509
504
wsbF := dbfake .WorkspaceBuild (t ,db , database.Workspace {Name :"f-workspace" ,OwnerID :firstUser .UserID ,OrganizationID :firstUser .OrganizationID }).Seed (database.WorkspaceBuild {Transition :database .WorkspaceTransitionStop }).Do ()
505
+
506
+ ctx ,cancel := context .WithTimeout (context .Background (),testutil .WaitLong )
507
+ defer cancel ()
510
508
require .NoError (t ,client .FavoriteWorkspace (ctx ,wsbF .Workspace .ID ))// need to do this via API call for now
511
509
512
510
workspacesResponse ,err := client .Workspaces (ctx , codersdk.WorkspaceFilter {})
@@ -517,9 +515,9 @@ func TestWorkspacesSortOrder(t *testing.T) {
517
515
wsbF .Workspace .Name ,// favorite
518
516
wsbA .Workspace .Name ,// running
519
517
wsbC .Workspace .Name ,// running
520
- wsbB .Workspace .Name ,// stopped,aaa < zzz
521
- wsbD .Workspace .Name ,// stopped, zzz >aaa
522
- wsbE .Workspace .Name ,// stopped, zzz >aaa
518
+ wsbB .Workspace .Name ,// stopped,testuser < zzz
519
+ wsbD .Workspace .Name ,// stopped, zzz >testuser
520
+ wsbE .Workspace .Name ,// stopped, zzz >testuser
523
521
}
524
522
525
523
actualNames := make ([]string ,0 ,len (expectedNames ))
@@ -543,10 +541,10 @@ func TestWorkspacesSortOrder(t *testing.T) {
543
541
expectedNames = []string {
544
542
wsbA .Workspace .Name ,// running
545
543
wsbC .Workspace .Name ,// running
546
- wsbB .Workspace .Name ,// stopped,aaa < zzz
547
- wsbF .Workspace .Name ,// stopped,aaa < zzz
548
- wsbD .Workspace .Name ,// stopped, zzz >aaa
549
- wsbE .Workspace .Name ,// stopped, zzz >aaa
544
+ wsbB .Workspace .Name ,// stopped,testuser < zzz
545
+ wsbF .Workspace .Name ,// stopped,testuser < zzz
546
+ wsbD .Workspace .Name ,// stopped, zzz >testuser
547
+ wsbE .Workspace .Name ,// stopped, zzz >testuser
550
548
}
551
549
552
550
actualNames = make ([]string ,0 ,len (expectedNames ))