Skip to content

Commit

Permalink
Evan dev h2 tab (#165)
Browse files Browse the repository at this point in the history
* Add H2 tab

* Refine sub-criteria

* Resolve merge conflict

* Fix manual validation on tests that did not require it

* Fix pending displayed when successful response already generated
  • Loading branch information
ebrockainq authored Oct 16, 2024
1 parent 2a16db3 commit c5bdf42
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/direct/hisp/TestCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ const TestCard = ({
}

const renderCriteriaMetIcon = () => {
if (criteriaMet === 'TRUE') {
if (criteriaMet === 'TRUE' || criteriaMet === 'PASSED') {
return <CheckCircleIcon style={{ color: 'green' }} />
} else if (criteriaMet === 'FALSE') {
return <CancelIcon style={{ color: 'red' }} />
Expand Down
14 changes: 11 additions & 3 deletions src/components/direct/hisp/XDRTestCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,14 @@ const TestCard = ({ test }: TestCardProps) => {
}
setTestRequestRequest(response.testRequest)
setTestRequestResponse(response.testResponse)
if (!testRequest && !testResponse && test.criteria && !manualValidationIDs.includes(test.id.toString())) {
if (
!testRequest &&
!testResponse &&
test.criteria &&
!manualValidationIDs.includes(test.id.toString()) &&
criteriaMet
) {
console.log('Response null, setting criteria met false')
setCriteriaMet('FALSE')
}
console.log('Criteria met: ', response.criteriaMet)
Expand Down Expand Up @@ -365,10 +372,11 @@ const TestCard = ({ test }: TestCardProps) => {
}

const renderCriteriaMetIcon = () => {
if (endpointsGenerated && criteriaMet != 'PASSED') {
console.log('criteria met icon: ', criteriaMet)
if (endpointsGenerated && criteriaMet != 'PASSED' && manualValidationIDs.includes(test.id.toString())) {
return <Typography style={{ color: 'red' }}>Pending</Typography>
}
if (criteriaMet === 'TRUE' || criteriaMet === 'PASSED') {
if (criteriaMet === 'TRUE' || criteriaMet === 'PASSED' || criteriaMet === 'SUCCESS') {
return <CheckCircleIcon style={{ color: 'green' }} />
} else if (criteriaMet === 'FALSE' || criteriaMet === 'ERROR') {
return <CancelIcon style={{ color: 'red' }} />
Expand Down

0 comments on commit c5bdf42

Please sign in to comment.