-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#526: Exclude untestable code from coverage
- Loading branch information
1 parent
2332a3a
commit 21bf09b
Showing
5 changed files
with
50 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 30 additions & 23 deletions
53
CourageScores/ClientApp/src/components/division_health/ViewHealthCheck.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,37 @@ | ||
import {isEmpty} from "../../helpers/collections"; | ||
import {useApp} from "../../AppContainer"; | ||
|
||
export function ViewHealthCheck({ result }) { | ||
const { onError } = useApp(); | ||
const healthy = result.success && isEmpty(result.errors) && isEmpty(result.warnings); | ||
|
||
return (<div datatype="view-health-check"> | ||
<h3 className={healthy ? 'text-success' : 'text-warning'}>Status: {healthy ? 'Healthy' : 'Unhealthy'}</h3> | ||
<ol> | ||
{Object.keys(result.checks).map(check => { | ||
const checkResult = result.checks[check]; | ||
try { | ||
return (<div datatype="view-health-check"> | ||
<h3 className={healthy ? 'text-success' : 'text-warning'}>Status: {healthy ? 'Healthy' : 'Unhealthy'}</h3> | ||
<ol> | ||
{Object.keys(result.checks).map(check => { | ||
const checkResult = result.checks[check]; | ||
|
||
return (<li key={check}> | ||
<div> | ||
{checkResult.success ? '✔' : '❌'} {check} | ||
</div> | ||
<div> | ||
{checkResult.errors.map((error, index) => (<div key={index} className="text-secondary-50 no-wrap">❌ {error}</div>))} | ||
{checkResult.warnings.map((warning, index) => (<div key={index} className="text-secondary-50 no-wrap">⚠ {warning}</div>))} | ||
{checkResult.messages.map((message, index) => (<div key={index} className="text-secondary-50 no-wrap">{message}</div>))} | ||
</div> | ||
</li>) | ||
})} | ||
</ol> | ||
<div> | ||
{result.errors.map((error, index) => (<div key={index} className="text-secondary no-wrap">❌ {error}</div>))} | ||
{result.warnings.map((warning, index) => (<div key={index} className="text-secondary no-wrap">⚠ {warning}</div>))} | ||
{result.messages.map((message, index) => (<div key={index} className="text-secondary no-wrap">{message}</div>))} | ||
</div> | ||
</div>); | ||
return (<li key={check}> | ||
<div> | ||
{checkResult.success ? '✔' : '❌'} {check} | ||
</div> | ||
<div> | ||
{checkResult.errors.map((error, index) => (<div key={index} className="text-secondary-50 no-wrap">❌ {error}</div>))} | ||
{checkResult.warnings.map((warning, index) => (<div key={index} className="text-secondary-50 no-wrap">⚠ {warning}</div>))} | ||
{checkResult.messages.map((message, index) => (<div key={index} className="text-secondary-50 no-wrap">{message}</div>))} | ||
</div> | ||
</li>) | ||
})} | ||
</ol> | ||
<div> | ||
{result.errors.map((error, index) => (<div key={index} className="text-secondary no-wrap">❌ {error}</div>))} | ||
{result.warnings.map((warning, index) => (<div key={index} className="text-secondary no-wrap">⚠ {warning}</div>))} | ||
{result.messages.map((message, index) => (<div key={index} className="text-secondary no-wrap">{message}</div>))} | ||
</div> | ||
</div>); | ||
} catch (e) { | ||
/* istanbul ignore next */ | ||
onError(e); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
CourageScores/Services/Health/Checks/FixturesAfterStartDate.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
CourageScores/Services/Health/Checks/FixturesBeforeEndDate.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters