@@ -9,46 +9,46 @@ class CoderWorkspacesStepViewTest extends Specification {
9
9
def table = new WorkspacesTable ()
10
10
table. listTableModel. items = List . of(
11
11
// An off workspace.
12
- DataGen . workspace (" ws1" , " ws1" ),
12
+ DataGen . workspaceAgentModel (" ws1" , " ws1" ),
13
13
14
14
// On workspaces.
15
- DataGen . workspace (" agent1" , " ws2" ),
16
- DataGen . workspace (" agent2" , " ws2" ),
17
- DataGen . workspace (" agent3" , " ws3" ),
15
+ DataGen . workspaceAgentModel (" agent1" , " ws2" ),
16
+ DataGen . workspaceAgentModel (" agent2" , " ws2" ),
17
+ DataGen . workspaceAgentModel (" agent3" , " ws3" ),
18
18
19
19
// Another off workspace.
20
- DataGen . workspace (" ws4" , " ws4" ),
20
+ DataGen . workspaceAgentModel (" ws4" , " ws4" ),
21
21
22
22
// In practice we do not list both agents and workspaces
23
23
// together but here test that anyway with an agent first and
24
24
// then with a workspace first.
25
- DataGen . workspace (" agent2" , " ws5" ),
26
- DataGen . workspace (" ws5" , " ws5" ),
27
- DataGen . workspace (" ws6" , " ws6" ),
28
- DataGen . workspace (" agent3" , " ws6" ),
25
+ DataGen . workspaceAgentModel (" agent2" , " ws5" ),
26
+ DataGen . workspaceAgentModel (" ws5" , " ws5" ),
27
+ DataGen . workspaceAgentModel (" ws6" , " ws6" ),
28
+ DataGen . workspaceAgentModel (" agent3" , " ws6" ),
29
29
)
30
30
31
31
expect :
32
32
table. getNewSelection(selected) == expected
33
33
34
34
where :
35
- selected | expected
36
- null | -1 // No selection.
37
- DataGen . workspace (" gone" , " gone" ) | -1 // No workspace that matches.
38
- DataGen . workspace (" ws1" , " ws1" ) | 0 // Workspace exact match.
39
- DataGen . workspace (" gone" , " ws1" ) | 0 // Agent gone, select workspace.
40
- DataGen . workspace (" ws2" , " ws2" ) | 1 // Workspace gone, select first agent.
41
- DataGen . workspace (" agent1" , " ws2" ) | 1 // Agent exact match.
42
- DataGen . workspace (" agent2" , " ws2" ) | 2 // Agent exact match.
43
- DataGen . workspace (" ws3" , " ws3" ) | 3 // Workspace gone, select first agent.
44
- DataGen . workspace (" agent3" , " ws3" ) | 3 // Agent exact match.
45
- DataGen . workspace (" gone" , " ws4" ) | 4 // Agent gone, select workspace.
46
- DataGen . workspace (" ws4" , " ws4" ) | 4 // Workspace exact match.
47
- DataGen . workspace (" agent2" , " ws5" ) | 5 // Agent exact match.
48
- DataGen . workspace (" gone" , " ws5" ) | 5 // Agent gone, another agent comes first.
49
- DataGen . workspace (" ws5" , " ws5" ) | 6 // Workspace exact match.
50
- DataGen . workspace (" ws6" , " ws6" ) | 7 // Workspace exact match.
51
- DataGen . workspace (" gone" , " ws6" ) | 7 // Agent gone, workspace comes first.
52
- DataGen . workspace (" agent3" , " ws6" ) | 8 // Agent exact match.
35
+ selected | expected
36
+ null | -1 // No selection.
37
+ DataGen . workspaceAgentModel (" gone" , " gone" ) | -1 // No workspace that matches.
38
+ DataGen . workspaceAgentModel (" ws1" , " ws1" ) | 0 // Workspace exact match.
39
+ DataGen . workspaceAgentModel (" gone" , " ws1" ) | 0 // Agent gone, select workspace.
40
+ DataGen . workspaceAgentModel (" ws2" , " ws2" ) | 1 // Workspace gone, select first agent.
41
+ DataGen . workspaceAgentModel (" agent1" , " ws2" ) | 1 // Agent exact match.
42
+ DataGen . workspaceAgentModel (" agent2" , " ws2" ) | 2 // Agent exact match.
43
+ DataGen . workspaceAgentModel (" ws3" , " ws3" ) | 3 // Workspace gone, select first agent.
44
+ DataGen . workspaceAgentModel (" agent3" , " ws3" ) | 3 // Agent exact match.
45
+ DataGen . workspaceAgentModel (" gone" , " ws4" ) | 4 // Agent gone, select workspace.
46
+ DataGen . workspaceAgentModel (" ws4" , " ws4" ) | 4 // Workspace exact match.
47
+ DataGen . workspaceAgentModel (" agent2" , " ws5" ) | 5 // Agent exact match.
48
+ DataGen . workspaceAgentModel (" gone" , " ws5" ) | 5 // Agent gone, another agent comes first.
49
+ DataGen . workspaceAgentModel (" ws5" , " ws5" ) | 6 // Workspace exact match.
50
+ DataGen . workspaceAgentModel (" ws6" , " ws6" ) | 7 // Workspace exact match.
51
+ DataGen . workspaceAgentModel (" gone" , " ws6" ) | 7 // Agent gone, workspace comes first.
52
+ DataGen . workspaceAgentModel (" agent3" , " ws6" ) | 8 // Agent exact match.
53
53
}
54
54
}
0 commit comments