-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1079 - writing test for registration launched from add member. creat…
…ed worklist factory to capture the creation of worklists to be used in test also.
- Loading branch information
1 parent
4945c2d
commit be283c6
Showing
13 changed files
with
112 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/* @flow */ | ||
import {AppRegistry} from 'react-native'; | ||
// import App from "./integrationTest/IntegrationTestApp"; | ||
import App from "./src/Avni"; | ||
AppRegistry.registerComponent('Avni', () => App); |
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
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,22 @@ | ||
import General from "../utility/General"; | ||
import {WorkItem, WorkList, WorkLists} from 'openchs-models'; | ||
|
||
class WorklistsFactory { | ||
static createForAddMember(memberSubject, member, individualRelative, isHeadOfHousehold, relativeGender) { | ||
const workItem = new WorkItem(General.randomUUID(), WorkItem.type.ADD_MEMBER, | ||
{ | ||
uuid: memberSubject.uuid, | ||
subjectTypeName: memberSubject.subjectType.name, | ||
member: member, | ||
individualRelative: individualRelative, | ||
headOfHousehold: isHeadOfHousehold, | ||
relativeGender: relativeGender, | ||
groupSubjectUUID: member.groupSubject.uuid | ||
} | ||
); | ||
const workList = new WorkList(`${memberSubject.subjectType.name} `, [workItem]); | ||
return new WorkLists(workList); | ||
} | ||
} | ||
|
||
export default WorklistsFactory; |
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
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
16 changes: 16 additions & 0 deletions
16
packages/openchs-android/test/model/txn/TestSubjectFactory.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {Individual} from 'openchs-models'; | ||
import General from "../../../src/utility/General"; | ||
|
||
class TestSubjectFactory { | ||
static createWithDefaults({subjectType, firstName, lastName, address}) { | ||
const individual = new Individual(); | ||
individual.uuid = General.randomUUID(); | ||
individual.subjectType = subjectType; | ||
individual.firstName = firstName; | ||
individual.lastName = lastName; | ||
individual.lowestAddressLevel = address; | ||
return individual; | ||
} | ||
} | ||
|
||
export default TestSubjectFactory; |