Skip to content

Commit b62d38b

Browse files
committed
Add test
1 parent fd17d74 commit b62d38b

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

client/tests/BotRunTestStatusList.test.jsx

+44
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,50 @@ test('correctly ignores test results from a human-submitted test plan run', asyn
9090
});
9191
});
9292

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+
status: COLLECTION_JOB_STATUS.COMPLETED,
115+
testStatus: [
116+
{ status: COLLECTION_JOB_STATUS.COMPLETED },
117+
{ status: COLLECTION_JOB_STATUS.COMPLETED },
118+
{ status: COLLECTION_JOB_STATUS.COMPLETED }
119+
]
120+
}
121+
];
122+
123+
const mocks = getMocks(testPlanRuns);
124+
125+
const { getByText } = render(
126+
<MockedProvider mocks={mocks} addTypename={false}>
127+
<BotRunTestStatusList testPlanReportId="1" />
128+
</MockedProvider>
129+
);
130+
131+
await waitFor(async () => {
132+
expect(getByText('3 Tests Completed')).toBeInTheDocument();
133+
expect(getByText('0 Tests Queued')).toBeInTheDocument();
134+
});
135+
});
136+
93137
test('correctly displays statuses for CANCELLED test run', async () => {
94138
const testPlanRuns = [
95139
{

0 commit comments

Comments
 (0)