@@ -29,6 +29,7 @@ describe('Case Schema', () => {
29
29
const pcr = Case . path ( 'victim.pcr' ) ;
30
30
const name = Case . path ( 'victim.name' ) ;
31
31
const mobile = Case . path ( 'victim.mobile' ) ;
32
+ const gender = Case . path ( 'victim.gender' ) ;
32
33
const occupation = Case . path ( 'victim.occupation' ) ;
33
34
const nationality = Case . path ( 'victim.nationality' ) ;
34
35
const nextOfKinName = Case . path ( 'victim.nextOfKin.name' ) ;
@@ -85,6 +86,22 @@ describe('Case Schema', () => {
85
86
expect ( mobile . options . exportable ) . to . be . true ;
86
87
expect ( mobile . options . fake ) . to . exist ;
87
88
89
+ expect ( gender ) . to . exist ;
90
+ expect ( gender ) . to . be . instanceof ( SchemaTypes . ObjectId ) ;
91
+ expect ( gender . options ) . to . exist ;
92
+ expect ( gender . options ) . to . be . an ( 'object' ) ;
93
+ expect ( gender . options . type ) . to . exist ;
94
+ expect ( gender . options . ref ) . to . exist ;
95
+ expect ( gender . options . ref ) . to . be . equal ( Predefine . MODEL_NAME ) ;
96
+ expect ( gender . options . index ) . to . be . true ;
97
+ // expect(gender.options.required).to.be.true;
98
+ expect ( gender . options . exists ) . to . be . true ;
99
+ expect ( gender . options . autopopulate ) . to . exist ;
100
+ expect ( gender . options . taggable ) . to . exist ;
101
+ expect ( gender . options . exportable ) . to . exist ;
102
+ expect ( gender . options . aggregatable ) . to . exist ;
103
+ expect ( gender . options . default ) . to . exist ;
104
+
88
105
expect ( occupation ) . to . exist ;
89
106
expect ( occupation ) . to . be . instanceof ( SchemaTypes . ObjectId ) ;
90
107
expect ( occupation . options ) . to . exist ;
@@ -99,7 +116,7 @@ describe('Case Schema', () => {
99
116
expect ( occupation . options . taggable ) . to . exist ;
100
117
expect ( occupation . options . exportable ) . to . exist ;
101
118
expect ( occupation . options . aggregatable ) . to . exist ;
102
- expect ( occupation . options . default ) . to . be . undefined ;
119
+ expect ( occupation . options . default ) . to . exist ;
103
120
104
121
expect ( nationality ) . to . exist ;
105
122
expect ( nationality ) . to . be . instanceof ( SchemaTypes . ObjectId ) ;
@@ -115,7 +132,7 @@ describe('Case Schema', () => {
115
132
expect ( nationality . options . taggable ) . to . exist ;
116
133
expect ( nationality . options . exportable ) . to . exist ;
117
134
expect ( nationality . options . aggregatable ) . to . exist ;
118
- expect ( nationality . options . default ) . to . be . undefined ;
135
+ expect ( nationality . options . default ) . to . exist ;
119
136
120
137
expect ( nextOfKinName ) . to . exist ;
121
138
expect ( nextOfKinName ) . to . be . instanceof ( SchemaTypes . String ) ;
0 commit comments