Skip to content

Commit a7d83df

Browse files
authored
Merge pull request #88 from topcoder-platform/TCA-503_remove-test-output
TCA-503 - (backend project) remove the tests output area if there are…
2 parents 69e629b + 2929412 commit a7d83df

File tree

1 file changed

+10
-7
lines changed
  • client/src/templates/Challenges/projects/backend

1 file changed

+10
-7
lines changed

client/src/templates/Challenges/projects/backend/Show.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ const mapStateToProps = createSelector(
5252
tests: Test[],
5353
isChallengeCompleted: boolean,
5454
isSignedIn: boolean,
55-
testsRunningSelector: boolean
55+
testsRunning: boolean
5656
) => ({
5757
tests,
5858
output,
5959
isChallengeCompleted,
6060
isSignedIn,
61-
testsRunningSelector
61+
testsRunning
6262
})
6363
);
6464

@@ -217,6 +217,7 @@ class BackEnd extends Component<BackEndProps> {
217217
updateSolutionFormValues
218218
} = this.props;
219219

220+
const hasTests = tests.length > 0;
220221
const isChallengeComplete = tests.every(test => test.pass && !test.err);
221222
const submitBtnLabel: string = !isChallengeComplete
222223
? `${t('buttons.run-test-2')}${testsRunning ? ' ...' : ''}`
@@ -260,16 +261,18 @@ class BackEnd extends Component<BackEndProps> {
260261
buttonLabel={submitBtnLabel}
261262
/>
262263
<br />
263-
<Output
264-
defaultOutput={`/**
264+
{hasTests && (
265+
<Output
266+
defaultOutput={`/**
265267
*
266268
* ${t('learn.test-output')}
267269
*
268270
*
269271
*/`}
270-
output={output}
271-
/>
272-
<TestSuite tests={tests} />
272+
output={output}
273+
/>
274+
)}
275+
{hasTests && <TestSuite tests={tests} />}
273276
<Spacer />
274277
</Col>
275278
</Row>

0 commit comments

Comments
 (0)