mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
@@ -28,6 +28,11 @@ func TestWorkspaceResource(t *testing.T) {
|
||||
Type: "example",
|
||||
Agents: []*proto.Agent{{
|
||||
Id: "something",
|
||||
Name: "b",
|
||||
Auth: &proto.Agent_Token{},
|
||||
}, {
|
||||
Id: "another",
|
||||
Name: "a",
|
||||
Auth: &proto.Agent_Token{},
|
||||
}},
|
||||
}},
|
||||
@@ -41,8 +46,12 @@ func TestWorkspaceResource(t *testing.T) {
|
||||
coderdtest.AwaitWorkspaceBuildJob(t, client, workspace.LatestBuild.ID)
|
||||
resources, err := client.WorkspaceResourcesByBuild(context.Background(), workspace.LatestBuild.ID)
|
||||
require.NoError(t, err)
|
||||
_, err = client.WorkspaceResource(context.Background(), resources[0].ID)
|
||||
resource, err := client.WorkspaceResource(context.Background(), resources[0].ID)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, resource.Agents, 2)
|
||||
// Ensure it's sorted alphabetically!
|
||||
require.Equal(t, "a", resource.Agents[0].Name)
|
||||
require.Equal(t, "b", resource.Agents[1].Name)
|
||||
})
|
||||
|
||||
t.Run("Apps", func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user