stand_socotra_policy_transformer 3.0.11 → 3.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/stand_underwriter.js +1 -1
- package/package.json +8 -2
- package/__tests__/__utils__/load_payload.js +0 -16
- package/__tests__/__utils__/payloads/ai_additional_insured_new.json +0 -90
- package/__tests__/__utils__/payloads/ai_no_change_new_payload.json +0 -103
- package/__tests__/__utils__/payloads/ai_no_change_old_payload.json +0 -764
- package/__tests__/__utils__/payloads/ai_old_payload.json +0 -707
- package/__tests__/__utils__/payloads/claims_new_policy.json +0 -117
- package/__tests__/__utils__/payloads/claims_remove_new_payload.json +0 -68
- package/__tests__/__utils__/payloads/claims_remove_socotra_policy.json +0 -785
- package/__tests__/__utils__/payloads/claims_socotra_payload.json +0 -764
- package/__tests__/__utils__/payloads/minimal_change_base.json +0 -574
- package/__tests__/__utils__/payloads/minimal_change_base2.json +0 -574
- package/__tests__/__utils__/payloads/minimal_change_resulting_socotra.json +0 -17
- package/__tests__/__utils__/payloads/minimal_change_resulting_socotra2.json +0 -27
- package/__tests__/__utils__/payloads/minimal_change_retool.json +0 -37
- package/__tests__/__utils__/payloads/minimal_change_retool2.json +0 -27
- package/__tests__/__utils__/payloads/sample_minimal_retool.json +0 -33
- package/__tests__/__utils__/payloads/sample_minimal_socotra_payload.json +0 -116
- package/__tests__/__utils__/payloads/sample_new_policy_holder.json +0 -17
- package/__tests__/__utils__/payloads/sample_new_quote.json +0 -216
- package/__tests__/__utils__/payloads/sample_new_quote_retool.json +0 -93
- package/__tests__/__utils__/payloads/sample_retool.json +0 -157
- package/__tests__/__utils__/payloads/sample_retool_converted_quote.json +0 -54
- package/__tests__/__utils__/payloads/sample_retool_socotra_subset.json +0 -163
- package/__tests__/__utils__/payloads/sample_socotra_quote.json +0 -782
- package/__tests__/__utils__/payloads/sample_socotra_with_additional_insured.json +0 -764
- package/__tests__/__utils__/payloads/sample_update_quote.json +0 -18
- package/__tests__/__utils__/payloads/versions/v1/sample_new_quote.json +0 -211
- package/__tests__/__utils__/payloads/versions/v1/sample_retool.json +0 -160
- package/__tests__/__utils__/payloads/versions/v1/sample_retool_socotra_subset.json +0 -128
- package/__tests__/__utils__/payloads/versions/v1/sample_socotra_quote.json +0 -776
- package/__tests__/__utils__/payloads/versions/v1/sample_update_quote.json +0 -18
- package/__tests__/__utils__/payloads/versions/v2/sample_new_quote.json +0 -215
- package/__tests__/__utils__/payloads/versions/v2/sample_retool.json +0 -165
- package/__tests__/__utils__/payloads/versions/v2/sample_retool_socotra_subset.json +0 -159
- package/__tests__/__utils__/payloads/versions/v2/sample_socotra_quote.json +0 -779
- package/__tests__/__utils__/payloads/versions/v2/sample_update_quote.json +0 -18
- package/__tests__/basic_knockout.test.js +0 -113
- package/__tests__/claims_history_knockout.test.js +0 -56
- package/__tests__/exterior_knockout.test.js +0 -192
- package/__tests__/helpers/index.js +0 -10
- package/__tests__/home_owner_knockouts.js +0 -260
- package/__tests__/interior_knockout.test.js +0 -321
- package/__tests__/package_version.test.js +0 -7
- package/__tests__/rate_call_knockouts.test.js +0 -347
- package/__tests__/retool_utils/socotra_group_update.test.js +0 -563
- package/__tests__/retool_utils/socotra_payload.test.js +0 -270
- package/__tests__/retool_utils/socotra_structure_helper.test.js +0 -242
- package/__tests__/retool_utils/versions/entries_v1.test.js +0 -51
- package/__tests__/retool_utils/versions/entries_v2.test.js +0 -51
- package/__tests__/underwriter.test.js +0 -169
- package/__tests__/wf_knockout.test.js +0 -124
- package/src/index.js +0 -14
- package/src/knockouts/basic_knockouts.js +0 -66
- package/src/knockouts/claims_history_knockout.js +0 -24
- package/src/knockouts/exterior_knockouts.js +0 -97
- package/src/knockouts/home_owner_knockouts.js +0 -118
- package/src/knockouts/index.js +0 -83
- package/src/knockouts/interior_knockouts.js +0 -149
- package/src/knockouts/rate_call_knockouts.js +0 -155
- package/src/knockouts/wf_knockouts.js +0 -66
- package/src/retool_to_socotra.js +0 -18
- package/src/retool_utils/socotra_entries_helper_fuctions.js +0 -0
- package/src/retool_utils/socotra_payloads.js +0 -161
- package/src/retool_utils/socotra_structure_helper.js +0 -687
- package/src/retool_utils/versions/stand_v1_entries.js +0 -167
- package/src/retool_utils/versions/stand_v2_entries.js +0 -211
- package/src/retool_utils/versions/stand_v3_entries.js +0 -274
- package/src/underwriter.js +0 -86
- package/webpack.config.js +0 -14
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
const { knockout, has_circuit_breaker } = require('../src/knockouts/index.js');
|
|
2
|
-
describe("Interior Knockouts", () =>
|
|
3
|
-
{
|
|
4
|
-
describe("is_vacant", () => {
|
|
5
|
-
|
|
6
|
-
test('accept if occupied', () => {
|
|
7
|
-
let decision = knockout('is_vacant', "No");
|
|
8
|
-
expect(decision.decision).toBe("accept");
|
|
9
|
-
expect(decision.note).toBe(null)
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
test('reject if vacant', () => {
|
|
13
|
-
let decision = knockout('is_vacant', "Yes");
|
|
14
|
-
expect(decision.decision).toBe("reject");
|
|
15
|
-
expect(decision.note).toBe("Home is vacant")
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
test('rejects if value is not yes or no', () => {
|
|
19
|
-
let decision = knockout('is_vacant', "hi");
|
|
20
|
-
expect(decision.decision).toBe("reject");
|
|
21
|
-
expect(decision.note).toBe("Vacant must be yes or no")
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
test('rejects if value is number', () => {
|
|
25
|
-
let decision = knockout('is_vacant', -4);
|
|
26
|
-
expect(decision.decision).toBe("reject");
|
|
27
|
-
expect(decision.note).toBe("Vacant must be yes or no")
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
describe("under_renovation", () => {
|
|
32
|
-
|
|
33
|
-
test('accept if no renovation', () => {
|
|
34
|
-
let decision = knockout('under_renovation', "No");
|
|
35
|
-
expect(decision.decision).toBe("accept");
|
|
36
|
-
expect(decision.note).toBe(null)
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
test('reject if under renovation', () => {
|
|
40
|
-
let decision = knockout('under_renovation', "Yes");
|
|
41
|
-
expect(decision.decision).toBe("reject");
|
|
42
|
-
expect(decision.note).toBe("Home is under renovation")
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
test('rejects if value is not yes or no', () => {
|
|
46
|
-
let decision = knockout('under_renovation', "hi");
|
|
47
|
-
expect(decision.decision).toBe("reject");
|
|
48
|
-
expect(decision.note).toBe("Under renovation must be yes or no")
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test('rejects if value is number', () => {
|
|
52
|
-
let decision = knockout('is_vacant', -4);
|
|
53
|
-
expect(decision.decision).toBe("reject");
|
|
54
|
-
expect(decision.note).toBe("Vacant must be yes or no")
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
describe("plumbing_last_update_year", () =>{
|
|
59
|
-
|
|
60
|
-
test('accept if plumbing is less than 30 years old', () =>{
|
|
61
|
-
let year = new Date().getFullYear();
|
|
62
|
-
let decision = knockout('plumbing_last_update_year', year - 22)
|
|
63
|
-
expect(decision.decision).toBe("accept");
|
|
64
|
-
expect(decision.note).toBe(null)
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
test('reject if plumbing is greater than 30 years old', () =>{
|
|
68
|
-
let decision = knockout('plumbing_last_update_year', 1993)
|
|
69
|
-
expect(decision.decision).toBe("reject");
|
|
70
|
-
expect(decision.note).toBe("Plumbing must have been updated in the last 30 years")
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
test('reject if plumbing is greater than 30 years old', () =>{
|
|
74
|
-
let decision = knockout('plumbing_last_update_year', 22)
|
|
75
|
-
expect(decision.decision).toBe("reject");
|
|
76
|
-
expect(decision.note).toBe("Plumbing input should be the year it was last updated not the age")
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
test('reject if plumbing is greater than 30 years old', () =>{
|
|
80
|
-
let decision = knockout('plumbing_last_update_year', "hi")
|
|
81
|
-
expect(decision.decision).toBe("reject");
|
|
82
|
-
expect(decision.note).toBe("Plumbing year must be an integer")
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
describe("water_heater_last_update_year", () => {
|
|
87
|
-
|
|
88
|
-
test('accept if water heater is less than 10 years old', () => {
|
|
89
|
-
let year = new Date().getFullYear();
|
|
90
|
-
let decision = knockout('water_heater_last_update_year', year - 10)
|
|
91
|
-
expect(decision.decision).toBe("accept");
|
|
92
|
-
expect(decision.note).toBe(null)
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
test('reject if water heater is greater than 10 years old', () => {
|
|
96
|
-
let decision = knockout('water_heater_last_update_year', 2013)
|
|
97
|
-
expect(decision.decision).toBe("reject");
|
|
98
|
-
expect(decision.note).toBe("Water heater must have been updated in the last 10 years")
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
test('reject if water heater year input is invalid', () => {
|
|
102
|
-
let decision = knockout('water_heater_last_update_year', "hi")
|
|
103
|
-
expect(decision.decision).toBe("reject");
|
|
104
|
-
expect(decision.note).toBe("Water heater year must be an integer")
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
test('reject if water heater year input is expressed as the age', () => {
|
|
108
|
-
let decision = knockout('water_heater_last_update_year', 10)
|
|
109
|
-
expect(decision.decision).toBe("reject");
|
|
110
|
-
expect(decision.note).toBe("Water heater input should be the year it was last updated not the age")
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
describe("electrical_last_update_year", () => {
|
|
115
|
-
|
|
116
|
-
test('accept if electrical is less than 30 years old', () => {
|
|
117
|
-
let year = new Date().getFullYear();
|
|
118
|
-
let decision = knockout('electrical_last_update_year', year - 30)
|
|
119
|
-
expect(decision.decision).toBe("accept");
|
|
120
|
-
expect(decision.note).toBe(null)
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
test('reject if electrical is greater than 10 years old', () => {
|
|
124
|
-
let decision = knockout('electrical_last_update_year', 1993)
|
|
125
|
-
expect(decision.decision).toBe("reject");
|
|
126
|
-
expect(decision.note).toBe("Electrical must have been updated in the last 30 years")
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
test('reject if electrical year input is invalid', () => {
|
|
130
|
-
let decision = knockout('electrical_last_update_year', "hi")
|
|
131
|
-
expect(decision.decision).toBe("reject");
|
|
132
|
-
expect(decision.note).toBe("Electrical year must be an integer")
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
test('reject if electrical year input is expressed as the age', () => {
|
|
136
|
-
let decision = knockout('electrical_last_update_year', 10)
|
|
137
|
-
expect(decision.decision).toBe("reject");
|
|
138
|
-
expect(decision.note).toBe("Electrical input should be the year it was last updated not the age")
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
describe("home_heating_last_update_year", () => {
|
|
142
|
-
|
|
143
|
-
test('accept if home heating system is less than 30 years old', () => {
|
|
144
|
-
let year = new Date().getFullYear();
|
|
145
|
-
let decision = knockout('home_heating_last_update_year', year - 30)
|
|
146
|
-
expect(decision.decision).toBe("accept");
|
|
147
|
-
expect(decision.note).toBe(null)
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
test('reject if home heating system is greater than 30 years old', () => {
|
|
151
|
-
let decision = knockout('home_heating_last_update_year', 1993)
|
|
152
|
-
expect(decision.decision).toBe("reject");
|
|
153
|
-
expect(decision.note).toBe("Home heating must have been updated in the last 30 years")
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
test('reject if home heating system year input is invalid', () => {
|
|
157
|
-
let decision = knockout('home_heating_last_update_year', "hi")
|
|
158
|
-
expect(decision.decision).toBe("reject");
|
|
159
|
-
expect(decision.note).toBe("Home heating year must be an integer")
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
test('reject if home heating system year input is expressed as the age', () => {
|
|
163
|
-
let decision = knockout('home_heating_last_update_year', 10)
|
|
164
|
-
expect(decision.decision).toBe("reject");
|
|
165
|
-
expect(decision.note).toBe("Home heating input should be the year it was last updated not the age")
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
describe("heating_source", () => {
|
|
170
|
-
|
|
171
|
-
test('accept if home heating source is not wood, pellet or coal', () => {
|
|
172
|
-
let decision = knockout('heating_source', "thermostatically controlled electrical heat")
|
|
173
|
-
expect(decision.decision).toBe("accept");
|
|
174
|
-
expect(decision.note).toBe(null)
|
|
175
|
-
|
|
176
|
-
decision = knockout('heating_source', "central gas heat")
|
|
177
|
-
expect(decision.decision).toBe("accept");
|
|
178
|
-
expect(decision.note).toBe(null)
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
test('refer if home heating source is wood pellet or coal', () => {
|
|
182
|
-
let decision = knockout('heating_source', "coal")
|
|
183
|
-
expect(decision.decision).toBe("refer");
|
|
184
|
-
expect(decision.note).toBe(null)
|
|
185
|
-
|
|
186
|
-
decision = knockout('heating_source', "wood")
|
|
187
|
-
expect(decision.decision).toBe("refer");
|
|
188
|
-
expect(decision.note).toBe(null)
|
|
189
|
-
|
|
190
|
-
decision = knockout('heating_source', "pellet stove")
|
|
191
|
-
expect(decision.decision).toBe("refer");
|
|
192
|
-
expect(decision.note).toBe(null)
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
test('reject if home heating system year input is invalid', () => {
|
|
196
|
-
let decision = knockout('heating_source', 3)
|
|
197
|
-
expect(decision.decision).toBe("reject");
|
|
198
|
-
expect(decision.note).toBe("Home heating year must be a string")
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
test('reject if home heating source is not in list', () => {
|
|
202
|
-
let decision = knockout('heating_source', "some random string")
|
|
203
|
-
expect(decision.decision).toBe("reject");
|
|
204
|
-
expect(decision.note).toBe("Heat source must be in [central gas heat, thermostatically controlled electrical heat, wood, coal, pellet stove]")
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
describe("has_underground_fuel_tank", () => {
|
|
209
|
-
|
|
210
|
-
test('accept if no tank', () => {
|
|
211
|
-
let decision = knockout('has_underground_fuel_tank', "No");
|
|
212
|
-
expect(decision.decision).toBe("accept");
|
|
213
|
-
expect(decision.note).toBe(null)
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
test('reject if it has a under ground tank', () => {
|
|
217
|
-
let decision = knockout('has_underground_fuel_tank', "Yes");
|
|
218
|
-
expect(decision.decision).toBe("reject");
|
|
219
|
-
expect(decision.note).toBe("Home has underground fuel tank")
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
test('rejects if value is not yes or no', () => {
|
|
223
|
-
let decision = knockout('has_underground_fuel_tank', "hi");
|
|
224
|
-
expect(decision.decision).toBe("reject");
|
|
225
|
-
expect(decision.note).toBe("Underground fuel tank must be yes or no")
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
test('rejects if value is number', () => {
|
|
229
|
-
let decision = knockout('has_underground_fuel_tank', -4);
|
|
230
|
-
expect(decision.decision).toBe("reject");
|
|
231
|
-
expect(decision.note).toBe("Underground fuel tank must be yes or no")
|
|
232
|
-
});
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
describe("has_steel_braided_hose", () => {
|
|
236
|
-
|
|
237
|
-
test('accept if no tank', () => {
|
|
238
|
-
let decision = knockout('has_steel_braided_hose', "Yes");
|
|
239
|
-
expect(decision.decision).toBe("accept");
|
|
240
|
-
expect(decision.note).toBe(null)
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
test('reject if it has a under ground tank', () => {
|
|
244
|
-
let decision = knockout('has_steel_braided_hose', "No");
|
|
245
|
-
expect(decision.decision).toBe("refer");
|
|
246
|
-
expect(decision.note).toBe(null)
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
test('rejects if value is not yes or no', () => {
|
|
250
|
-
let decision = knockout('has_steel_braided_hose', "hi");
|
|
251
|
-
expect(decision.decision).toBe("reject");
|
|
252
|
-
expect(decision.note).toBe("Steel braided hose must be yes or no")
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
test('rejects if value is number', () => {
|
|
256
|
-
let decision = knockout('has_steel_braided_hose', -4);
|
|
257
|
-
expect(decision.decision).toBe("reject");
|
|
258
|
-
expect(decision.note).toBe("Steel braided hose must be yes or no")
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
describe("has_water_shutoff", () => {
|
|
263
|
-
|
|
264
|
-
test('accept if it has a shutoff', () => {
|
|
265
|
-
let decision = knockout('has_water_shutoff', "Yes");
|
|
266
|
-
expect(decision.decision).toBe("accept");
|
|
267
|
-
expect(decision.note).toBe(null)
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
test('refer if it does not', () => {
|
|
271
|
-
let decision = knockout('has_water_shutoff', "No");
|
|
272
|
-
expect(decision.decision).toBe("refer");
|
|
273
|
-
expect(decision.note).toBe(null)
|
|
274
|
-
});
|
|
275
|
-
|
|
276
|
-
test('rejects if value is not yes or no', () => {
|
|
277
|
-
let decision = knockout('has_water_shutoff', "hi");
|
|
278
|
-
expect(decision.decision).toBe("reject");
|
|
279
|
-
expect(decision.note).toBe("Water shutoff must be yes or no")
|
|
280
|
-
});
|
|
281
|
-
|
|
282
|
-
test('rejects if value is number', () => {
|
|
283
|
-
let decision = knockout('has_water_shutoff', -4);
|
|
284
|
-
expect(decision.decision).toBe("reject");
|
|
285
|
-
expect(decision.note).toBe("Water shutoff must be yes or no")
|
|
286
|
-
});
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
describe("has_circuit_breaker", () => {
|
|
290
|
-
|
|
291
|
-
test('reject if pre 1980 homes with a circuit breaker', () => {
|
|
292
|
-
let decision = has_circuit_breaker( "Yes", 1979);
|
|
293
|
-
expect(decision.decision).toBe("reject");
|
|
294
|
-
expect(decision.note).toBe("Home built before 1980 cannot have circuit breakers")
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
test('accept if post 1980 homes with a circuit breaker', () => {
|
|
298
|
-
let decision = has_circuit_breaker( "Yes", 1988);
|
|
299
|
-
expect(decision.decision).toBe("accept");
|
|
300
|
-
expect(decision.note).toBe(null)
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
test('refer if it does not', () => {
|
|
304
|
-
let decision = has_circuit_breaker( "No", 1979);
|
|
305
|
-
expect(decision.decision).toBe("accept");
|
|
306
|
-
expect(decision.note).toBe(null)
|
|
307
|
-
});
|
|
308
|
-
|
|
309
|
-
test('rejects if value is not yes or no', () => {
|
|
310
|
-
let decision =has_circuit_breaker( "hi", 1979);
|
|
311
|
-
expect(decision.decision).toBe("reject");
|
|
312
|
-
expect(decision.note).toBe("Circuit breaker must be yes or no")
|
|
313
|
-
});
|
|
314
|
-
|
|
315
|
-
test('rejects if value is number', () => {
|
|
316
|
-
let decision = has_circuit_breaker( 4, 1979);
|
|
317
|
-
expect(decision.decision).toBe("reject");
|
|
318
|
-
expect(decision.note).toBe("Circuit breaker must be yes or no")
|
|
319
|
-
});
|
|
320
|
-
});
|
|
321
|
-
})
|
|
@@ -1,347 +0,0 @@
|
|
|
1
|
-
const { knockout} = require('../src/knockouts');
|
|
2
|
-
const {has_class_a_roof} = require('../src/knockouts/rate_call_knockouts')
|
|
3
|
-
describe("Rate Call Knockouts", () =>
|
|
4
|
-
{
|
|
5
|
-
describe("construction_type", () => {
|
|
6
|
-
|
|
7
|
-
test('accept if most construction types', () => {
|
|
8
|
-
let decision = knockout('construction_type', "Concrete");
|
|
9
|
-
expect(decision.decision).toBe("accept");
|
|
10
|
-
expect(decision.note).toBe(null)
|
|
11
|
-
|
|
12
|
-
decision = knockout('construction_type', "Masonry");
|
|
13
|
-
expect(decision.decision).toBe("accept");
|
|
14
|
-
expect(decision.note).toBe(null)
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
test('reject if Log, Mobile, Manufactured or modular', () => {
|
|
18
|
-
let decision = knockout('construction_type', "Log");
|
|
19
|
-
expect(decision.decision).toBe("reject");
|
|
20
|
-
expect(decision.note).toBe("Construction type not supported")
|
|
21
|
-
|
|
22
|
-
decision = knockout('construction_type', "Modular");
|
|
23
|
-
expect(decision.decision).toBe("reject");
|
|
24
|
-
expect(decision.note).toBe("Construction type not supported")
|
|
25
|
-
|
|
26
|
-
decision = knockout('construction_type', "Mobile / Manufactured");
|
|
27
|
-
expect(decision.decision).toBe("reject");
|
|
28
|
-
expect(decision.note).toBe("Construction type not supported")
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
test('rejects if value is not an number', () => {
|
|
32
|
-
let decision = knockout('construction_type', "hi");
|
|
33
|
-
expect(decision.decision).toBe("reject");
|
|
34
|
-
expect(decision.note).toBe("Construction type must be one of [Concrete, Frame, Log, Masonry, Mobile / Manufactured, Steel, Modular]")
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
test('rejects if value is not a string', () => {
|
|
38
|
-
let decision = knockout('construction_type', -3);
|
|
39
|
-
expect(decision.decision).toBe("reject");
|
|
40
|
-
expect(decision.note).toBe("Construction type must be a string")
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
describe("siding_material", () => {
|
|
45
|
-
|
|
46
|
-
test('accept if most siding types', () => {
|
|
47
|
-
let decision = knockout('siding_material', "Adobe");
|
|
48
|
-
expect(decision.decision).toBe("accept");
|
|
49
|
-
expect(decision.note).toBe(null)
|
|
50
|
-
|
|
51
|
-
decision = knockout('siding_material', "Cement Fiber");
|
|
52
|
-
expect(decision.decision).toBe("accept");
|
|
53
|
-
expect(decision.note).toBe(null)
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
test('reject if Asbestos, log, eifs', () => {
|
|
57
|
-
let decision = knockout('siding_material', "Asbestos");
|
|
58
|
-
expect(decision.decision).toBe("reject");
|
|
59
|
-
expect(decision.note).toBe("Siding material not supported")
|
|
60
|
-
|
|
61
|
-
decision = knockout('siding_material', "Log");
|
|
62
|
-
expect(decision.decision).toBe("reject");
|
|
63
|
-
expect(decision.note).toBe("Siding material not supported")
|
|
64
|
-
|
|
65
|
-
decision = knockout('siding_material', "Exterior Insulation Finishing System (EIFS)");
|
|
66
|
-
expect(decision.decision).toBe("reject");
|
|
67
|
-
expect(decision.note).toBe("Siding material not supported")
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
test('rejects if value is not an number', () => {
|
|
71
|
-
let decision = knockout('siding_material', "hi");
|
|
72
|
-
expect(decision.decision).toBe("reject");
|
|
73
|
-
expect(decision.note).toBe("Siding material must be one of [Adobe, Aluminum / Steel, Asbestos, Brick / Masonry Veneer, Brick / Stone - Solid, Cement Fiber, Clapboard, Exterior Insulation Finishing System (EIFS), Log, Stone Veneer, Stucco, Vinyl, Wood, Other - above descriptions do not apply]")
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
test('rejects if value is not a string', () => {
|
|
77
|
-
let decision = knockout('siding_material', -3);
|
|
78
|
-
expect(decision.decision).toBe("reject");
|
|
79
|
-
expect(decision.note).toBe("Siding material must be a string")
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
describe("protection_class", () => {
|
|
84
|
-
|
|
85
|
-
test('accept if most protection classes', () => {
|
|
86
|
-
let decision = knockout('protection_class', "6");
|
|
87
|
-
expect(decision.decision).toBe("accept");
|
|
88
|
-
expect(decision.note).toBe(null)
|
|
89
|
-
|
|
90
|
-
decision = knockout('protection_class', "7Y");
|
|
91
|
-
expect(decision.decision).toBe("accept");
|
|
92
|
-
expect(decision.note).toBe(null)
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
test('reject if 9 or 10', () => {
|
|
96
|
-
let decision = knockout('protection_class', "9");
|
|
97
|
-
expect(decision.decision).toBe("reject");
|
|
98
|
-
expect(decision.note).toBe("Protection class not supported")
|
|
99
|
-
|
|
100
|
-
decision = knockout('protection_class', "10");
|
|
101
|
-
expect(decision.decision).toBe("reject");
|
|
102
|
-
expect(decision.note).toBe("Protection class not supported")
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
test('rejects if value is not an number', () => {
|
|
106
|
-
let decision = knockout('protection_class', "hi");
|
|
107
|
-
expect(decision.decision).toBe("reject");
|
|
108
|
-
expect(decision.note).toBe("Protection class must be one of 1,2,3,4,5,6,7,8,8B,1Y,2Y,3Y,4Y,5Y,6Y,7Y,8Y,9,1X,2X,3X,4X,5X,6X,7X,8X,9,10,10W")
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
test('rejects if value is not a string', () => {
|
|
112
|
-
let decision = knockout('protection_class', -3);
|
|
113
|
-
expect(decision.decision).toBe("reject");
|
|
114
|
-
expect(decision.note).toBe("Protection class must be a string")
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
describe("roof_material", () => {
|
|
119
|
-
|
|
120
|
-
test('accept if most roof materials', () => {
|
|
121
|
-
let decision = knockout('roof_material', "Architecture Shingles");
|
|
122
|
-
expect(decision.decision).toBe("accept");
|
|
123
|
-
expect(decision.note).toBe(null)
|
|
124
|
-
|
|
125
|
-
decision = knockout('roof_material', "Corrugated Steel - Metal");
|
|
126
|
-
expect(decision.decision).toBe("accept");
|
|
127
|
-
expect(decision.note).toBe(null)
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
test('reject if Wood Shake or Wood Shingle', () => {
|
|
131
|
-
let decision = knockout('roof_material', "Wood Shake");
|
|
132
|
-
expect(decision.decision).toBe("reject");
|
|
133
|
-
expect(decision.note).toBe("Roof material not supported")
|
|
134
|
-
|
|
135
|
-
decision = knockout('roof_material', "Wood Shingle");
|
|
136
|
-
expect(decision.decision).toBe("reject");
|
|
137
|
-
expect(decision.note).toBe("Roof material not supported")
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
test('rejects if value is not an number', () => {
|
|
141
|
-
let decision = knockout('roof_material', "hi");
|
|
142
|
-
expect(decision.decision).toBe("reject");
|
|
143
|
-
expect(decision.note).toBe("Roof material must be one of Architecture Shingles,Asphalt Fiberglass Composite,Clay-Tile-Slate,Concrete Tile,Corrugated Steel - Metal,Flat Foam Composite, Flat Membrane,Flat Tar Gravel,Other,Wood Shake,Wood Shingle")
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
test('rejects if value is not a string', () => {
|
|
147
|
-
let decision = knockout('roof_material', -3);
|
|
148
|
-
expect(decision.decision).toBe("reject");
|
|
149
|
-
expect(decision.note).toBe("Roof material must be a string")
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
describe("has_class_a_roof", () => {
|
|
154
|
-
|
|
155
|
-
test('accept if it has a class a roof', () => {
|
|
156
|
-
let decision = has_class_a_roof( "Yes", 'C');
|
|
157
|
-
expect(decision.decision).toBe("accept");
|
|
158
|
-
expect(decision.note).toBe(null)
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
test('reject if it does not', () => {
|
|
162
|
-
let decision = has_class_a_roof("No", 'C');
|
|
163
|
-
expect(decision.decision).toBe("reject");
|
|
164
|
-
expect(decision.note).toBe("Homes in this wildfire category must have class a roofs")
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
test('accept if it doesnt have a class a roof but is in an a or b category', () => {
|
|
168
|
-
let decision = has_class_a_roof("No", 'B');
|
|
169
|
-
expect(decision.decision).toBe("accept");
|
|
170
|
-
expect(decision.note).toBe(null)
|
|
171
|
-
|
|
172
|
-
decision = has_class_a_roof("No", 'A');
|
|
173
|
-
expect(decision.decision).toBe("accept");
|
|
174
|
-
expect(decision.note).toBe(null)
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
test('rejects if value is not yes or no', () => {
|
|
178
|
-
let decision = has_class_a_roof( "hi", 'C');
|
|
179
|
-
expect(decision.decision).toBe("reject");
|
|
180
|
-
expect(decision.note).toBe("Has class a roof must be Yes or No")
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
test('rejects if value is number', () => {
|
|
184
|
-
let decision = has_class_a_roof( -4, 'C');
|
|
185
|
-
expect(decision.decision).toBe("reject");
|
|
186
|
-
expect(decision.note).toBe("Has class a roof must be a string")
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
describe('foundation_type', () =>{
|
|
191
|
-
test('accept if most foundation types', () => {
|
|
192
|
-
let decision = knockout('foundation_type', "Slab");
|
|
193
|
-
expect(decision.decision).toBe("accept");
|
|
194
|
-
expect(decision.note).toBe(null)
|
|
195
|
-
|
|
196
|
-
decision = knockout('foundation_type', "Crawlspace");
|
|
197
|
-
expect(decision.decision).toBe("accept");
|
|
198
|
-
expect(decision.note).toBe(null)
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
test('reject if Piers, Pilings, Stilts;', () => {
|
|
202
|
-
let decision = knockout('foundation_type', "Piers");
|
|
203
|
-
expect(decision.decision).toBe("reject");
|
|
204
|
-
expect(decision.note).toBe("Foundation type not supported")
|
|
205
|
-
|
|
206
|
-
decision = knockout('foundation_type', "Pilings");
|
|
207
|
-
expect(decision.decision).toBe("reject");
|
|
208
|
-
expect(decision.note).toBe("Foundation type not supported")
|
|
209
|
-
|
|
210
|
-
decision = knockout('foundation_type', "Stilts");
|
|
211
|
-
expect(decision.decision).toBe("reject");
|
|
212
|
-
expect(decision.note).toBe("Foundation type not supported")
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
test('refer if other', () => {
|
|
216
|
-
let decision = knockout('foundation_type', "Other");
|
|
217
|
-
expect(decision.decision).toBe("refer");
|
|
218
|
-
expect(decision.note).toBe(null)
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
test('rejects if value is not an number', () => {
|
|
222
|
-
let decision = knockout('foundation_type', "hi");
|
|
223
|
-
expect(decision.decision).toBe("reject");
|
|
224
|
-
expect(decision.note).toBe("Foundation type must be one of Basement Finished,Basement Partially Finished,Basement Unfinished,Crawlspace,Other,Piers,Pilings,Stilts,Slab")
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
test('rejects if value is not a string', () => {
|
|
228
|
-
let decision = knockout('foundation_type', -3);
|
|
229
|
-
expect(decision.decision).toBe("reject");
|
|
230
|
-
expect(decision.note).toBe("Foundation type must be a string")
|
|
231
|
-
});
|
|
232
|
-
})
|
|
233
|
-
|
|
234
|
-
describe('has_slab_foundation_plumbing', () => {
|
|
235
|
-
test('accept if no plumbing in slab foundation', () => {
|
|
236
|
-
let decision = knockout('has_slab_foundation_plumbing', "No");
|
|
237
|
-
expect(decision.decision).toBe("accept");
|
|
238
|
-
expect(decision.note).toBe(null)
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
test('reject if it has', () => {
|
|
242
|
-
let decision = knockout('has_slab_foundation_plumbing', "Yes");
|
|
243
|
-
expect(decision.decision).toBe("reject");
|
|
244
|
-
expect(decision.note).toBe("Homes with slab foundation plumbing are not allowed")
|
|
245
|
-
});
|
|
246
|
-
|
|
247
|
-
test('rejects if value is not yes or no', () => {
|
|
248
|
-
let decision = knockout('has_slab_foundation_plumbing', "hi");
|
|
249
|
-
expect(decision.decision).toBe("reject");
|
|
250
|
-
expect(decision.note).toBe("Has slab foundation plumbing must be Yes or No")
|
|
251
|
-
});
|
|
252
|
-
|
|
253
|
-
test('rejects if value is number', () => {
|
|
254
|
-
let decision = knockout('has_slab_foundation_plumbing', -4);
|
|
255
|
-
expect(decision.decision).toBe("reject");
|
|
256
|
-
expect(decision.note).toBe("Has slab foundation plumbing must be a string")
|
|
257
|
-
});
|
|
258
|
-
});
|
|
259
|
-
|
|
260
|
-
describe('fire_protective_devices', () => {
|
|
261
|
-
test('accept if it has two devices', () => {
|
|
262
|
-
let decision = knockout("fire_protective_devices", ["Direct"])
|
|
263
|
-
expect(decision.note).toBe(null)
|
|
264
|
-
expect(decision.decision).toBe("accept");
|
|
265
|
-
|
|
266
|
-
decision = knockout("fire_protective_devices", ["Central", "Sprinkler"])
|
|
267
|
-
expect(decision.note).toBe(null)
|
|
268
|
-
expect(decision.decision).toBe("accept");
|
|
269
|
-
|
|
270
|
-
decision = knockout("fire_protective_devices", ["Direct", "Fire Ext", "Smoke"])
|
|
271
|
-
expect(decision.note).toBe(null)
|
|
272
|
-
expect(decision.decision).toBe("accept");
|
|
273
|
-
});
|
|
274
|
-
|
|
275
|
-
test('reject if it has no devices', () => {
|
|
276
|
-
let decision = knockout("fire_protective_devices", [])
|
|
277
|
-
expect(decision.note).toBe("Insufficient fire devices")
|
|
278
|
-
expect(decision.decision).toBe("reject");
|
|
279
|
-
|
|
280
|
-
decision = knockout("fire_protective_devices", ["Local"])
|
|
281
|
-
expect(decision.note).toBe("Insufficient fire devices")
|
|
282
|
-
expect(decision.decision).toBe("reject");
|
|
283
|
-
|
|
284
|
-
decision = knockout("fire_protective_devices", ["No"])
|
|
285
|
-
expect(decision.note).toBe("Insufficient fire devices")
|
|
286
|
-
expect(decision.decision).toBe("reject");
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
test('reject if it has an unrecognized device', () => {
|
|
290
|
-
let decision = knockout("fire_protective_devices", ["Central", "other_alarm_type"])
|
|
291
|
-
expect(decision.note).toBe("Unrecognized fire device type. Valid devices: Local,Central,Direct,Sprinkler,Fire Ext,Smoke,No")
|
|
292
|
-
expect(decision.decision).toBe("reject");
|
|
293
|
-
});
|
|
294
|
-
|
|
295
|
-
test('rejects if value is number', () => {
|
|
296
|
-
let decision = knockout('fire_protective_devices', -4);
|
|
297
|
-
expect(decision.decision).toBe("reject");
|
|
298
|
-
expect(decision.note).toBe("Fire protective devices must be a list")
|
|
299
|
-
});
|
|
300
|
-
})
|
|
301
|
-
|
|
302
|
-
describe('theft_protective_devices', () => {
|
|
303
|
-
test('accept if it has one of the required devices', () => {
|
|
304
|
-
let decision = knockout("theft_protective_devices", ["Direct"])
|
|
305
|
-
expect(decision.note).toBe(null)
|
|
306
|
-
expect(decision.decision).toBe("accept");
|
|
307
|
-
|
|
308
|
-
decision = knockout("theft_protective_devices", ["Central", "Dead Bolt"])
|
|
309
|
-
expect(decision.note).toBe(null)
|
|
310
|
-
expect(decision.decision).toBe("accept");
|
|
311
|
-
|
|
312
|
-
decision = knockout("theft_protective_devices", ["24 Hour Security Guard"])
|
|
313
|
-
expect(decision.note).toBe(null)
|
|
314
|
-
expect(decision.decision).toBe("accept");
|
|
315
|
-
});
|
|
316
|
-
|
|
317
|
-
test('reject if it has no devices', () => {
|
|
318
|
-
let decision = knockout("theft_protective_devices", [])
|
|
319
|
-
expect(decision.note).toBe("Insufficient theft device")
|
|
320
|
-
expect(decision.decision).toBe("reject");
|
|
321
|
-
|
|
322
|
-
decision = knockout("theft_protective_devices", ["Local"])
|
|
323
|
-
expect(decision.note).toBe("Insufficient theft device")
|
|
324
|
-
expect(decision.decision).toBe("reject");
|
|
325
|
-
|
|
326
|
-
decision = knockout("theft_protective_devices", ["Dead Bolt"])
|
|
327
|
-
expect(decision.note).toBe("Insufficient theft device")
|
|
328
|
-
expect(decision.decision).toBe("reject");
|
|
329
|
-
|
|
330
|
-
decision = knockout("theft_protective_devices", ["No"])
|
|
331
|
-
expect(decision.note).toBe("Insufficient theft device")
|
|
332
|
-
expect(decision.decision).toBe("reject");
|
|
333
|
-
});
|
|
334
|
-
|
|
335
|
-
test('reject if it has no recognized devices', () => {
|
|
336
|
-
let decision = knockout("theft_protective_devices", ["Central", "other_alarm_type"])
|
|
337
|
-
expect(decision.note).toBe("Unrecognized theft device type. Valid devices: Dead Bolt,Local,Central,Direct,24 Hour Security Guard,No")
|
|
338
|
-
expect(decision.decision).toBe("reject");
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
test('rejects if value is number', () => {
|
|
342
|
-
let decision = knockout('theft_protective_devices', -4);
|
|
343
|
-
expect(decision.decision).toBe("reject");
|
|
344
|
-
expect(decision.note).toBe("Theft protective devices must be a list")
|
|
345
|
-
});
|
|
346
|
-
});
|
|
347
|
-
})
|