How about representing the logic as a JavaScript expression:
(credentialData.rapidSarsCov2PCRTest.testResult==='negative')
|| credentialData.covid19Vaccination.hasVaccination)
? 'valid' : 'invalid'
Seem easier to read and maintain to me.