@@ -26,7 +26,7 @@ test('correctly displays statuses for single COMPLETED test run', async () => {
26
26
{
27
27
id : '0' ,
28
28
testResults : new Array ( 3 ) . fill ( null ) ,
29
- tester : { username : 'bot' } ,
29
+ tester : { username : 'bot' , isBot : true } ,
30
30
collectionJob : {
31
31
status : COLLECTION_JOB_STATUS . COMPLETED ,
32
32
testStatus : [
@@ -59,7 +59,7 @@ test('correctly ignores test results from a human-submitted test plan run', asyn
59
59
{
60
60
id : '0' ,
61
61
testResults : new Array ( 2 ) . fill ( null ) ,
62
- tester : { username : 'bot' } ,
62
+ tester : { username : 'bot' , isBot : true } ,
63
63
collectionJob : {
64
64
status : COLLECTION_JOB_STATUS . COMPLETED ,
65
65
testStatus : [
@@ -71,7 +71,7 @@ test('correctly ignores test results from a human-submitted test plan run', asyn
71
71
{
72
72
id : '1' ,
73
73
testResults : new Array ( 2 ) . fill ( null ) ,
74
- tester : { username : 'human' } ,
74
+ tester : { username : 'human' , isBot : false } ,
75
75
collectionJob : null
76
76
}
77
77
] ;
@@ -90,12 +90,58 @@ test('correctly ignores test results from a human-submitted test plan run', asyn
90
90
} ) ;
91
91
} ) ;
92
92
93
+ // See gh-1237 - Check if user is a bot, to include in Bot Status calculation on Test Queue page
94
+ // https://github.com/w3c/aria-at-app/pull/1237
95
+ test ( 'correctly ignores test results from a human-submitted test plan run with a collectionJob attribute' , async ( ) => {
96
+ const testPlanRuns = [
97
+ {
98
+ id : '0' ,
99
+ testResults : new Array ( 3 ) . fill ( null ) ,
100
+ tester : { username : 'bot' , isBot : true } ,
101
+ collectionJob : {
102
+ status : COLLECTION_JOB_STATUS . COMPLETED ,
103
+ testStatus : [
104
+ { status : COLLECTION_JOB_STATUS . COMPLETED } ,
105
+ { status : COLLECTION_JOB_STATUS . COMPLETED } ,
106
+ { status : COLLECTION_JOB_STATUS . COMPLETED }
107
+ ]
108
+ }
109
+ } ,
110
+ {
111
+ id : '1' ,
112
+ testResults : new Array ( 3 ) . fill ( null ) ,
113
+ tester : { username : 'human' , isBot : false } ,
114
+ collectionJob : {
115
+ status : COLLECTION_JOB_STATUS . COMPLETED ,
116
+ testStatus : [
117
+ { status : COLLECTION_JOB_STATUS . COMPLETED } ,
118
+ { status : COLLECTION_JOB_STATUS . COMPLETED } ,
119
+ { status : COLLECTION_JOB_STATUS . COMPLETED }
120
+ ]
121
+ }
122
+ }
123
+ ] ;
124
+
125
+ const mocks = getMocks ( testPlanRuns ) ;
126
+
127
+ const { getByText } = render (
128
+ < MockedProvider mocks = { mocks } addTypename = { false } >
129
+ < BotRunTestStatusList testPlanReportId = "1" />
130
+ </ MockedProvider >
131
+ ) ;
132
+
133
+ await waitFor ( async ( ) => {
134
+ expect ( getByText ( '3 Tests Completed' ) ) . toBeInTheDocument ( ) ;
135
+ expect ( getByText ( '0 Tests Queued' ) ) . toBeInTheDocument ( ) ;
136
+ } ) ;
137
+ } ) ;
138
+
93
139
test ( 'correctly displays statuses for CANCELLED test run' , async ( ) => {
94
140
const testPlanRuns = [
95
141
{
96
142
id : '0' ,
97
143
testResults : new Array ( 2 ) . fill ( null ) ,
98
- tester : { username : 'bot' } ,
144
+ tester : { username : 'bot' , isBot : true } ,
99
145
collectionJob : {
100
146
status : COLLECTION_JOB_STATUS . CANCELLED ,
101
147
testStatus : [
@@ -127,7 +173,7 @@ test('correctly displays statuses for multiple RUNNING and QUEUED test runs', as
127
173
{
128
174
id : '0' ,
129
175
testResults : new Array ( 2 ) . fill ( null ) ,
130
- tester : { username : 'bot' } ,
176
+ tester : { username : 'bot' , isBot : true } ,
131
177
collectionJob : {
132
178
status : COLLECTION_JOB_STATUS . RUNNING ,
133
179
testStatus : [
@@ -140,7 +186,7 @@ test('correctly displays statuses for multiple RUNNING and QUEUED test runs', as
140
186
{
141
187
id : '1' ,
142
188
testResults : new Array ( 2 ) . fill ( null ) ,
143
- tester : { username : 'bot' } ,
189
+ tester : { username : 'bot' , isBot : true } ,
144
190
collectionJob : {
145
191
status : COLLECTION_JOB_STATUS . CANCELLED ,
146
192
testStatus : [
0 commit comments