-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avniproject/avni-webapp#1203 - methods to support standard report car…
…d types
- Loading branch information
1 parent
201b9e6
commit 637ee4b
Showing
5 changed files
with
43 additions
and
13 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import ReportCardFactory from "./ref/ReportCardFactory"; | ||
import StandardReportCardTypeFactory from "./ref/StandardReportCardTypeFactory"; | ||
import StandardReportCardType from "../src/StandardReportCardType"; | ||
import {assert} from 'chai'; | ||
|
||
it('is subject type filter supported', function () { | ||
const approvedType = StandardReportCardTypeFactory.create({name: StandardReportCardType.type.Approved}); | ||
const reportCard = ReportCardFactory.create({standardReportCardType: approvedType}); | ||
assert.equal(reportCard.isSubjectTypeFilterSupported(), false); | ||
reportCard.standardReportCardType = StandardReportCardTypeFactory.create({name: StandardReportCardType.type.ScheduledVisits}); | ||
assert.equal(reportCard.isSubjectTypeFilterSupported(), true); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import _ from "lodash"; | ||
import {ReportCard} from "../../src"; | ||
|
||
class ReportCardFactory { | ||
static create({standardReportCardType}) { | ||
const reportCard = new ReportCard(); | ||
reportCard.standardReportCardType = standardReportCardType; | ||
return reportCard; | ||
} | ||
} | ||
|
||
export default ReportCardFactory; |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import StandardReportCardType from "../../src/StandardReportCardType"; | ||
|
||
class StandardReportCardTypeFactory { | ||
static create({name}) { | ||
const standardReportCardType = new StandardReportCardType(); | ||
standardReportCardType.name = name; | ||
return standardReportCardType; | ||
} | ||
} | ||
|
||
export default StandardReportCardTypeFactory; |