diff --git a/src/components/project_view/submission_detail/ag_test_command_result_detail.vue b/src/components/project_view/submission_detail/ag_test_command_result_detail.vue index 9bfc0f84..285e1b94 100644 --- a/src/components/project_view/submission_detail/ag_test_command_result_detail.vue +++ b/src/components/project_view/submission_detail/ag_test_command_result_detail.vue @@ -33,7 +33,9 @@ {'actual-return-code-correct': ag_test_command_result !== null && ag_test_command_result.return_code_correct, 'actual-return-code-incorrect': ag_test_command_result !== null - && !ag_test_command_result.return_code_correct}]" + // return_code_correct can be null so we need to check for false + // to avoid showing the red warning color when it's null + && ag_test_command_result.return_code_correct === false}]" >{{ag_test_command_result.actual_return_code}} diff --git a/tests/test_components/test_project_view/test_submission_detail/test_ag_test_command_result_detail.ts b/tests/test_components/test_project_view/test_submission_detail/test_ag_test_command_result_detail.ts index 786e3daa..f69a9392 100644 --- a/tests/test_components/test_project_view/test_submission_detail/test_ag_test_command_result_detail.ts +++ b/tests/test_components/test_project_view/test_submission_detail/test_ag_test_command_result_detail.ts @@ -164,6 +164,17 @@ describe('Correctness feedback tests', () => { ); }); + test('Actual return code available, return code not checked', async () => { + ag_test_command_result.expected_return_code = ag_cli.ExpectedReturnCode.none; + ag_test_command_result.return_code_correct = null; + // https://github.com/eecs-autograder/autograder.io/issues/30 + // Any status should be correct, including 2 + ag_test_command_result.actual_return_code = 2; + let wrapper = await make_wrapper(); + let section_wrapper = wrapper.findComponent({ref: 'actual_return_code'}); + expect(section_wrapper.find('.actual-return-code-incorrect').exists()).toBe(false); + }); + test('Expected return code available, return code not checked', async () => { ag_test_command_result.expected_return_code = ag_cli.ExpectedReturnCode.none; let wrapper = await make_wrapper();