Skip to content

Commit

Permalink
Merge branch 'release/0.21.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
lykmapipo committed Jun 9, 2020
2 parents 2b5017e + 7ada0d6 commit 23f0f6c
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 25 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
#### 0.21.1 (2020-06-09)

##### Chores

* **deps:** force latest version & audit fix ([8f9f310c](https://github.com/codetanzania/ewea-common/commit/8f9f310caef10f7d0e1a385038604fba5fb9f27f))

##### Bug Fixes

* **helpers:** return seeded case severity ([f9807512](https://github.com/codetanzania/ewea-common/commit/f9807512a5913af3cf03103ff2b519fbca9d2091))

#### 0.21.0 (2020-06-09)

##### Chores
Expand Down
10 changes: 5 additions & 5 deletions es/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,27 +366,27 @@ const caseSeverityFor = (optns) => {

// special
if (score === 0) {
return COMMON_CASESEVERITIES.Asymptomatic;
return COMMON_CASESEVERITY_SEEDS.Asymptomatic;
}

// mild
if (score > 0 && score <= 2) {
return COMMON_CASESEVERITIES.Mild;
return COMMON_CASESEVERITY_SEEDS.Mild;
}

// moderate
if (score > 2 && score <= 3) {
return COMMON_CASESEVERITIES.Moderate;
return COMMON_CASESEVERITY_SEEDS.Moderate;
}

// severe
if (score > 3 && score <= 4) {
return COMMON_CASESEVERITIES.Severe;
return COMMON_CASESEVERITY_SEEDS.Severe;
}

// critical
if (score > 4) {
return COMMON_CASESEVERITIES.Critical;
return COMMON_CASESEVERITY_SEEDS.Critical;
}

// return default
Expand Down
10 changes: 5 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,27 +367,27 @@ const caseSeverityFor = (optns) => {

// special
if (score === 0) {
return COMMON_CASESEVERITIES.Asymptomatic;
return COMMON_CASESEVERITY_SEEDS.Asymptomatic;
}

// mild
if (score > 0 && score <= 2) {
return COMMON_CASESEVERITIES.Mild;
return COMMON_CASESEVERITY_SEEDS.Mild;
}

// moderate
if (score > 2 && score <= 3) {
return COMMON_CASESEVERITIES.Moderate;
return COMMON_CASESEVERITY_SEEDS.Moderate;
}

// severe
if (score > 3 && score <= 4) {
return COMMON_CASESEVERITIES.Severe;
return COMMON_CASESEVERITY_SEEDS.Severe;
}

// critical
if (score > 4) {
return COMMON_CASESEVERITIES.Critical;
return COMMON_CASESEVERITY_SEEDS.Critical;
}

// return default
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@codetanzania/ewea-common",
"version": "0.21.0",
"version": "0.21.1",
"description": "Common utilities for EWEA",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down
10 changes: 5 additions & 5 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,27 +397,27 @@ export const caseSeverityFor = (optns) => {

// special
if (score === 0) {
return COMMON_CASESEVERITIES.Asymptomatic;
return COMMON_CASESEVERITY_SEEDS.Asymptomatic;
}

// mild
if (score > 0 && score <= 2) {
return COMMON_CASESEVERITIES.Mild;
return COMMON_CASESEVERITY_SEEDS.Mild;
}

// moderate
if (score > 2 && score <= 3) {
return COMMON_CASESEVERITIES.Moderate;
return COMMON_CASESEVERITY_SEEDS.Moderate;
}

// severe
if (score > 3 && score <= 4) {
return COMMON_CASESEVERITIES.Severe;
return COMMON_CASESEVERITY_SEEDS.Severe;
}

// critical
if (score > 4) {
return COMMON_CASESEVERITIES.Critical;
return COMMON_CASESEVERITY_SEEDS.Critical;
}

// return default
Expand Down
20 changes: 12 additions & 8 deletions test/unit/constants.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,31 +250,35 @@ describe('constants', () => {
).to.be.true;

severity = caseSeverityFor({ score: 1 });
expect(areSameObjectId(severity, COMMON_CASESEVERITIES.Mild)).to.be.true;
expect(areSameObjectId(severity, COMMON_CASESEVERITY_SEEDS.Mild)).to.be
.true;

severity = caseSeverityFor({ score: 2 });
expect(areSameObjectId(severity, COMMON_CASESEVERITIES.Mild)).to.be.true;
expect(areSameObjectId(severity, COMMON_CASESEVERITY_SEEDS.Mild)).to.be
.true;

severity = caseSeverityFor({ score: 2.5 });
expect(areSameObjectId(severity, COMMON_CASESEVERITIES.Moderate)).to.be
expect(areSameObjectId(severity, COMMON_CASESEVERITY_SEEDS.Moderate)).to.be
.true;

severity = caseSeverityFor({ score: 3 });
expect(areSameObjectId(severity, COMMON_CASESEVERITIES.Moderate)).to.be
expect(areSameObjectId(severity, COMMON_CASESEVERITY_SEEDS.Moderate)).to.be
.true;

severity = caseSeverityFor({ score: 3.5 });
expect(areSameObjectId(severity, COMMON_CASESEVERITIES.Severe)).to.be.true;
expect(areSameObjectId(severity, COMMON_CASESEVERITY_SEEDS.Severe)).to.be
.true;

severity = caseSeverityFor({ score: 4 });
expect(areSameObjectId(severity, COMMON_CASESEVERITIES.Severe)).to.be.true;
expect(areSameObjectId(severity, COMMON_CASESEVERITY_SEEDS.Severe)).to.be
.true;

severity = caseSeverityFor({ score: 4.5 });
expect(areSameObjectId(severity, COMMON_CASESEVERITIES.Critical)).to.be
expect(areSameObjectId(severity, COMMON_CASESEVERITY_SEEDS.Critical)).to.be
.true;

severity = caseSeverityFor({ score: 5 });
expect(areSameObjectId(severity, COMMON_CASESEVERITIES.Critical)).to.be
expect(areSameObjectId(severity, COMMON_CASESEVERITY_SEEDS.Critical)).to.be
.true;
});
});

0 comments on commit 23f0f6c

Please sign in to comment.