@dmptool/types 1.0.2 → 1.0.3
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/answers/__tests__/answers.spec.js +32 -32
- package/dist/answers/answer.d.ts +2 -2
- package/dist/answers/answer.js +2 -2
- package/dist/answers/dateAnswers.d.ts +4 -4
- package/dist/answers/dateAnswers.js +3 -3
- package/dist/answers/graphQLAnswers.d.ts +4 -4
- package/dist/answers/graphQLAnswers.js +3 -3
- package/dist/answers/index.d.ts +2 -2
- package/dist/answers/index.js +17 -17
- package/dist/answers/optionBasedAnswers.d.ts +6 -6
- package/dist/answers/optionBasedAnswers.js +4 -4
- package/dist/answers/primitiveAnswers.d.ts +14 -14
- package/dist/answers/primitiveAnswers.js +8 -8
- package/dist/answers/tableAnswers.d.ts +4 -4
- package/dist/answers/tableAnswers.js +18 -18
- package/dist/questions/__tests__/dateQuestions.spec.js +6 -6
- package/dist/questions/__tests__/graphQLQuestions.spec.js +4 -4
- package/dist/questions/__tests__/optionBasedQuestions.spec.js +6 -6
- package/dist/questions/__tests__/primitiveQuestions.spec.js +14 -14
- package/dist/questions/dateQuestions.d.ts +4 -4
- package/dist/questions/dateQuestions.js +5 -5
- package/dist/questions/graphQLQuestions.d.ts +4 -4
- package/dist/questions/graphQLQuestions.js +3 -3
- package/dist/questions/index.d.ts +2 -2
- package/dist/questions/index.js +17 -17
- package/dist/questions/optionBasedQuestions.d.ts +6 -6
- package/dist/questions/optionBasedQuestions.js +11 -11
- package/dist/questions/primitiveQuestions.d.ts +14 -14
- package/dist/questions/primitiveQuestions.js +8 -8
- package/dist/questions/question.d.ts +2 -2
- package/dist/questions/question.js +2 -2
- package/dist/questions/tableQuestions.d.ts +4 -4
- package/dist/questions/tableQuestions.js +18 -18
- package/package.json +1 -1
|
@@ -11,27 +11,27 @@ const questions_1 = require("../../questions");
|
|
|
11
11
|
(0, globals_1.describe)('Answer Type Validations', () => {
|
|
12
12
|
(0, globals_1.it)('should validate BooleanAnswer', () => {
|
|
13
13
|
const validData = { type: 'boolean', answer: true, meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
14
|
-
(0, globals_1.expect)(() => primitiveAnswers_1.
|
|
14
|
+
(0, globals_1.expect)(() => primitiveAnswers_1.BooleanAnswerSchema.parse(validData)).not.toThrow();
|
|
15
15
|
const invalidData = { type: 'boolean', answer: 'true' };
|
|
16
|
-
(0, globals_1.expect)(() => primitiveAnswers_1.
|
|
16
|
+
(0, globals_1.expect)(() => primitiveAnswers_1.BooleanAnswerSchema.parse(invalidData)).toThrow();
|
|
17
17
|
});
|
|
18
18
|
(0, globals_1.it)('should validate CheckboxesAnswer', () => {
|
|
19
19
|
const validData = { type: 'checkBoxes', answer: ['option1', 'option2'], meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
20
|
-
(0, globals_1.expect)(() => optionBasedAnswers_1.
|
|
20
|
+
(0, globals_1.expect)(() => optionBasedAnswers_1.CheckboxesAnswerSchema.parse(validData)).not.toThrow();
|
|
21
21
|
const invalidData = { type: 'checkBoxes', answer: 'option1', meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
22
|
-
(0, globals_1.expect)(() => optionBasedAnswers_1.
|
|
22
|
+
(0, globals_1.expect)(() => optionBasedAnswers_1.CheckboxesAnswerSchema.parse(invalidData)).toThrow();
|
|
23
23
|
});
|
|
24
24
|
(0, globals_1.it)('should validate CurrencyAnswer', () => {
|
|
25
25
|
const validData = { type: 'currency', answer: 100.5, meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
26
|
-
(0, globals_1.expect)(() => primitiveAnswers_1.
|
|
26
|
+
(0, globals_1.expect)(() => primitiveAnswers_1.CurrencyAnswerSchema.parse(validData)).not.toThrow();
|
|
27
27
|
const invalidData = { type: 'currency', answer: '100.5', meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
28
|
-
(0, globals_1.expect)(() => primitiveAnswers_1.
|
|
28
|
+
(0, globals_1.expect)(() => primitiveAnswers_1.CurrencyAnswerSchema.parse(invalidData)).toThrow();
|
|
29
29
|
});
|
|
30
30
|
(0, globals_1.it)('should validate DatePickerAnswer', () => {
|
|
31
31
|
const validData = { type: 'datePicker', answer: '2023-10-01', meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
32
|
-
(0, globals_1.expect)(() => dateAnswers_1.
|
|
32
|
+
(0, globals_1.expect)(() => dateAnswers_1.DatePickerAnswerSchema.parse(validData)).not.toThrow();
|
|
33
33
|
const invalidData = { type: 'datePicker', answer: 12345, meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
34
|
-
(0, globals_1.expect)(() => dateAnswers_1.
|
|
34
|
+
(0, globals_1.expect)(() => dateAnswers_1.DatePickerAnswerSchema.parse(invalidData)).toThrow();
|
|
35
35
|
});
|
|
36
36
|
(0, globals_1.it)('should validate DateRangeAnswer', () => {
|
|
37
37
|
const validData = {
|
|
@@ -39,67 +39,67 @@ const questions_1 = require("../../questions");
|
|
|
39
39
|
answer: { start: '2023-10-01', end: '2023-10-31' },
|
|
40
40
|
meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION }
|
|
41
41
|
};
|
|
42
|
-
(0, globals_1.expect)(() => dateAnswers_1.
|
|
42
|
+
(0, globals_1.expect)(() => dateAnswers_1.DateRangeAnswerSchema.parse(validData)).not.toThrow();
|
|
43
43
|
const invalidData = {
|
|
44
44
|
type: 'dateRange',
|
|
45
45
|
answer: { start: '2023-10-01', end: 12345 },
|
|
46
46
|
meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION }
|
|
47
47
|
};
|
|
48
|
-
(0, globals_1.expect)(() => dateAnswers_1.
|
|
48
|
+
(0, globals_1.expect)(() => dateAnswers_1.DateRangeAnswerSchema.parse(invalidData)).toThrow();
|
|
49
49
|
});
|
|
50
50
|
(0, globals_1.it)('should validate EmailAnswer', () => {
|
|
51
51
|
const validData = { type: 'email', answer: 'test@example.com', meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
52
|
-
(0, globals_1.expect)(() => primitiveAnswers_1.
|
|
52
|
+
(0, globals_1.expect)(() => primitiveAnswers_1.EmailAnswerSchema.parse(validData)).not.toThrow();
|
|
53
53
|
const invalidData = { type: 'email', answer: 12345 };
|
|
54
|
-
(0, globals_1.expect)(() => primitiveAnswers_1.
|
|
54
|
+
(0, globals_1.expect)(() => primitiveAnswers_1.EmailAnswerSchema.parse(invalidData)).toThrow();
|
|
55
55
|
});
|
|
56
56
|
(0, globals_1.it)('should validate FilteredSearchAnswer', () => {
|
|
57
57
|
const validData = { type: 'filteredSearch', answer: ['item1', 'item2'], meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
58
|
-
(0, globals_1.expect)(() => graphQLAnswers_1.
|
|
58
|
+
(0, globals_1.expect)(() => graphQLAnswers_1.FilteredSearchAnswerSchema.parse(validData)).not.toThrow();
|
|
59
59
|
const invalidData = { type: 'filteredSearch', answer: 'item1', meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
60
|
-
(0, globals_1.expect)(() => graphQLAnswers_1.
|
|
60
|
+
(0, globals_1.expect)(() => graphQLAnswers_1.FilteredSearchAnswerSchema.parse(invalidData)).toThrow();
|
|
61
61
|
});
|
|
62
62
|
(0, globals_1.it)('should validate NumberAnswer', () => {
|
|
63
63
|
const validData = { type: 'number', answer: 42, meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
64
|
-
(0, globals_1.expect)(() => primitiveAnswers_1.
|
|
64
|
+
(0, globals_1.expect)(() => primitiveAnswers_1.NumberAnswerSchema.parse(validData)).not.toThrow();
|
|
65
65
|
const invalidData = { type: 'number', answer: '42', meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
66
|
-
(0, globals_1.expect)(() => primitiveAnswers_1.
|
|
66
|
+
(0, globals_1.expect)(() => primitiveAnswers_1.NumberAnswerSchema.parse(invalidData)).toThrow();
|
|
67
67
|
});
|
|
68
68
|
(0, globals_1.it)('should validate RadioButtonsAnswer', () => {
|
|
69
69
|
const validData = { type: 'radioButtons', answer: 'option1', meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
70
|
-
(0, globals_1.expect)(() => optionBasedAnswers_1.
|
|
70
|
+
(0, globals_1.expect)(() => optionBasedAnswers_1.RadioButtonsAnswerSchema.parse(validData)).not.toThrow();
|
|
71
71
|
const invalidData = { type: 'radioButtons', answer: ['option1'], meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
72
|
-
(0, globals_1.expect)(() => optionBasedAnswers_1.
|
|
72
|
+
(0, globals_1.expect)(() => optionBasedAnswers_1.RadioButtonsAnswerSchema.parse(invalidData)).toThrow();
|
|
73
73
|
});
|
|
74
74
|
(0, globals_1.it)('should validate SelectBoxAnswer', () => {
|
|
75
75
|
const validData = { type: 'selectBox', answer: ['option1'], meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
76
|
-
(0, globals_1.expect)(() => optionBasedAnswers_1.
|
|
76
|
+
(0, globals_1.expect)(() => optionBasedAnswers_1.SelectBoxAnswerSchema.parse(validData)).not.toThrow();
|
|
77
77
|
const invalidData = { type: 'selectBox', answer: 'option1', meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
78
|
-
(0, globals_1.expect)(() => optionBasedAnswers_1.
|
|
78
|
+
(0, globals_1.expect)(() => optionBasedAnswers_1.SelectBoxAnswerSchema.parse(invalidData)).toThrow();
|
|
79
79
|
});
|
|
80
80
|
(0, globals_1.it)('should validate TextAnswer', () => {
|
|
81
81
|
const validData = { type: 'text', answer: 'Some text', meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
82
|
-
(0, globals_1.expect)(() => primitiveAnswers_1.
|
|
82
|
+
(0, globals_1.expect)(() => primitiveAnswers_1.TextAnswerSchema.parse(validData)).not.toThrow();
|
|
83
83
|
const invalidData = { type: 'text', answer: 12345, meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
84
|
-
(0, globals_1.expect)(() => primitiveAnswers_1.
|
|
84
|
+
(0, globals_1.expect)(() => primitiveAnswers_1.TextAnswerSchema.parse(invalidData)).toThrow();
|
|
85
85
|
});
|
|
86
86
|
(0, globals_1.it)('should validate TextAreaAnswer', () => {
|
|
87
87
|
const validData = { type: 'textArea', answer: 'Some long text', meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
88
|
-
(0, globals_1.expect)(() => primitiveAnswers_1.
|
|
88
|
+
(0, globals_1.expect)(() => primitiveAnswers_1.TextAreaAnswerSchema.parse(validData)).not.toThrow();
|
|
89
89
|
const invalidData = { type: 'textArea', answer: 12345, meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
90
|
-
(0, globals_1.expect)(() => primitiveAnswers_1.
|
|
90
|
+
(0, globals_1.expect)(() => primitiveAnswers_1.TextAreaAnswerSchema.parse(invalidData)).toThrow();
|
|
91
91
|
});
|
|
92
92
|
(0, globals_1.it)('should validate TypeaheadSearchAnswer', () => {
|
|
93
93
|
const validData = { type: 'typeaheadSearch', answer: 'Search term', meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
94
|
-
(0, globals_1.expect)(() => graphQLAnswers_1.
|
|
94
|
+
(0, globals_1.expect)(() => graphQLAnswers_1.TypeaheadSearchAnswerSchema.parse(validData)).not.toThrow();
|
|
95
95
|
const invalidData = { type: 'typeaheadSearch', answer: 12345, meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
96
|
-
(0, globals_1.expect)(() => graphQLAnswers_1.
|
|
96
|
+
(0, globals_1.expect)(() => graphQLAnswers_1.TypeaheadSearchAnswerSchema.parse(invalidData)).toThrow();
|
|
97
97
|
});
|
|
98
98
|
(0, globals_1.it)('should validate URLAnswer', () => {
|
|
99
99
|
const validData = { type: 'url', answer: 'https://example.com', meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
100
|
-
(0, globals_1.expect)(() => primitiveAnswers_1.
|
|
100
|
+
(0, globals_1.expect)(() => primitiveAnswers_1.URLAnswerSchema.parse(validData)).not.toThrow();
|
|
101
101
|
const invalidData = { type: 'url', answer: 12345, meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
102
|
-
(0, globals_1.expect)(() => primitiveAnswers_1.
|
|
102
|
+
(0, globals_1.expect)(() => primitiveAnswers_1.URLAnswerSchema.parse(invalidData)).toThrow();
|
|
103
103
|
});
|
|
104
104
|
(0, globals_1.it)('should validate TableAnswer', () => {
|
|
105
105
|
const validData = {
|
|
@@ -110,18 +110,18 @@ const questions_1 = require("../../questions");
|
|
|
110
110
|
],
|
|
111
111
|
meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION }
|
|
112
112
|
};
|
|
113
|
-
(0, globals_1.expect)(() => tableAnswers_1.
|
|
113
|
+
(0, globals_1.expect)(() => tableAnswers_1.TableAnswerSchema.parse(validData)).not.toThrow();
|
|
114
114
|
const invalidData = {
|
|
115
115
|
type: 'table',
|
|
116
116
|
answer: [{ type: 'text', answer: 12345 }],
|
|
117
117
|
meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION }
|
|
118
118
|
};
|
|
119
|
-
(0, globals_1.expect)(() => tableAnswers_1.
|
|
119
|
+
(0, globals_1.expect)(() => tableAnswers_1.TableAnswerSchema.parse(invalidData)).toThrow();
|
|
120
120
|
});
|
|
121
121
|
(0, globals_1.it)('should validate AnyAnswer', () => {
|
|
122
122
|
const validData = { type: 'text', answer: 'Some text', meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
123
|
-
(0, globals_1.expect)(() => __1.
|
|
123
|
+
(0, globals_1.expect)(() => __1.AnyAnswerSchema.parse(validData)).not.toThrow();
|
|
124
124
|
const invalidData = { type: 'unknown', answer: 'Some text', meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION } };
|
|
125
|
-
(0, globals_1.expect)(() => __1.
|
|
125
|
+
(0, globals_1.expect)(() => __1.AnyAnswerSchema.parse(invalidData)).toThrow();
|
|
126
126
|
});
|
|
127
127
|
});
|
package/dist/answers/answer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const AnswerSchema: z.ZodObject<{
|
|
3
3
|
type: z.ZodEnum<["boolean", "checkBoxes", "currency", "datePicker", "dateRange", "email", "filteredSearch", "number", "option", "radioButtons", "selectBox", "table", "text", "textArea", "typeaheadSearch", "url"]>;
|
|
4
4
|
answer: z.ZodString;
|
|
5
5
|
meta: z.ZodObject<{
|
|
@@ -22,4 +22,4 @@ export declare const Answer: z.ZodObject<{
|
|
|
22
22
|
};
|
|
23
23
|
answer: string;
|
|
24
24
|
}>;
|
|
25
|
-
export type AnswerType = z.infer<typeof
|
|
25
|
+
export type AnswerType = z.infer<typeof AnswerSchema>;
|
package/dist/answers/answer.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.AnswerSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const question_1 = require("../questions/question");
|
|
6
6
|
// Abstract base schema for all answers
|
|
7
|
-
exports.
|
|
7
|
+
exports.AnswerSchema = zod_1.z.object({
|
|
8
8
|
type: question_1.QuestionTypesEnum, // The type of answer
|
|
9
9
|
answer: zod_1.z.string(), // The answer to the question (string)
|
|
10
10
|
meta: zod_1.z.object({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const DatePickerAnswerSchema: z.ZodObject<{
|
|
3
3
|
answer: z.ZodString;
|
|
4
4
|
meta: z.ZodObject<{
|
|
5
5
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
@@ -23,7 +23,7 @@ export declare const DatePickerAnswer: z.ZodObject<{
|
|
|
23
23
|
};
|
|
24
24
|
answer: string;
|
|
25
25
|
}>;
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const DateRangeAnswerSchema: z.ZodObject<{
|
|
27
27
|
meta: z.ZodObject<{
|
|
28
28
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
29
29
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -62,5 +62,5 @@ export declare const DateRangeAnswer: z.ZodObject<{
|
|
|
62
62
|
end: string;
|
|
63
63
|
};
|
|
64
64
|
}>;
|
|
65
|
-
export type DatePickerAnswerType = z.infer<typeof
|
|
66
|
-
export type DateRangeAnswerType = z.infer<typeof
|
|
65
|
+
export type DatePickerAnswerType = z.infer<typeof DatePickerAnswerSchema>;
|
|
66
|
+
export type DateRangeAnswerType = z.infer<typeof DateRangeAnswerSchema>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DateRangeAnswerSchema = exports.DatePickerAnswerSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const answer_1 = require("./answer");
|
|
6
6
|
// Answers to Date Question Types
|
|
7
|
-
exports.
|
|
7
|
+
exports.DatePickerAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
8
8
|
type: zod_1.z.literal('datePicker'), // The type of question
|
|
9
9
|
}));
|
|
10
|
-
exports.
|
|
10
|
+
exports.DateRangeAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
11
11
|
type: zod_1.z.literal('dateRange'), // The type of answer
|
|
12
12
|
answer: zod_1.z.object({
|
|
13
13
|
start: zod_1.z.string(), // The start date (string)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const FilteredSearchAnswerSchema: z.ZodObject<{
|
|
3
3
|
meta: z.ZodObject<{
|
|
4
4
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
5
5
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -23,7 +23,7 @@ export declare const FilteredSearchAnswer: z.ZodObject<{
|
|
|
23
23
|
};
|
|
24
24
|
answer: string[];
|
|
25
25
|
}>;
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const TypeaheadSearchAnswerSchema: z.ZodObject<{
|
|
27
27
|
meta: z.ZodObject<{
|
|
28
28
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
29
29
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -47,5 +47,5 @@ export declare const TypeaheadSearchAnswer: z.ZodObject<{
|
|
|
47
47
|
};
|
|
48
48
|
answer: string;
|
|
49
49
|
}>;
|
|
50
|
-
export type FilteredSearchAnswerType = z.infer<typeof
|
|
51
|
-
export type TypeaheadSearchAnswerType = z.infer<typeof
|
|
50
|
+
export type FilteredSearchAnswerType = z.infer<typeof FilteredSearchAnswerSchema>;
|
|
51
|
+
export type TypeaheadSearchAnswerType = z.infer<typeof TypeaheadSearchAnswerSchema>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TypeaheadSearchAnswerSchema = exports.FilteredSearchAnswerSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const answer_1 = require("./answer");
|
|
6
6
|
// Answers to GraphQL Question Types
|
|
7
|
-
exports.
|
|
7
|
+
exports.FilteredSearchAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
8
8
|
type: zod_1.z.literal('filteredSearch'), // The type of answer
|
|
9
9
|
answer: zod_1.z.array(zod_1.z.string()) // The answer to the filtered search (array of strings)
|
|
10
10
|
}));
|
|
11
|
-
exports.
|
|
11
|
+
exports.TypeaheadSearchAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
12
12
|
type: zod_1.z.literal('typeaheadSearch'), // The type of answer
|
|
13
13
|
answer: zod_1.z.string() // The answer to the typeahead search (string)
|
|
14
14
|
}));
|
package/dist/answers/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export * from './graphQLAnswers';
|
|
|
5
5
|
export * from './optionBasedAnswers';
|
|
6
6
|
export * from './primitiveAnswers';
|
|
7
7
|
export * from './tableAnswers';
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
9
9
|
meta: z.ZodObject<{
|
|
10
10
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -877,4 +877,4 @@ export declare const AnyAnswer: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
877
877
|
};
|
|
878
878
|
answer: string;
|
|
879
879
|
}>]>;
|
|
880
|
-
export type AnyAnswerType = z.infer<typeof
|
|
880
|
+
export type AnyAnswerType = z.infer<typeof AnyAnswerSchema>;
|
package/dist/answers/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.AnyAnswerSchema = void 0;
|
|
18
18
|
const zod_1 = require("zod");
|
|
19
19
|
const dateAnswers_1 = require("./dateAnswers");
|
|
20
20
|
const graphQLAnswers_1 = require("./graphQLAnswers");
|
|
@@ -29,20 +29,20 @@ __exportStar(require("./optionBasedAnswers"), exports);
|
|
|
29
29
|
__exportStar(require("./primitiveAnswers"), exports);
|
|
30
30
|
__exportStar(require("./tableAnswers"), exports);
|
|
31
31
|
// Union of all possible answers
|
|
32
|
-
exports.
|
|
33
|
-
primitiveAnswers_1.
|
|
34
|
-
optionBasedAnswers_1.
|
|
35
|
-
primitiveAnswers_1.
|
|
36
|
-
dateAnswers_1.
|
|
37
|
-
dateAnswers_1.
|
|
38
|
-
primitiveAnswers_1.
|
|
39
|
-
graphQLAnswers_1.
|
|
40
|
-
primitiveAnswers_1.
|
|
41
|
-
optionBasedAnswers_1.
|
|
42
|
-
optionBasedAnswers_1.
|
|
43
|
-
tableAnswers_1.
|
|
44
|
-
primitiveAnswers_1.
|
|
45
|
-
primitiveAnswers_1.
|
|
46
|
-
graphQLAnswers_1.
|
|
47
|
-
primitiveAnswers_1.
|
|
32
|
+
exports.AnyAnswerSchema = zod_1.z.discriminatedUnion('type', [
|
|
33
|
+
primitiveAnswers_1.BooleanAnswerSchema,
|
|
34
|
+
optionBasedAnswers_1.CheckboxesAnswerSchema,
|
|
35
|
+
primitiveAnswers_1.CurrencyAnswerSchema,
|
|
36
|
+
dateAnswers_1.DatePickerAnswerSchema,
|
|
37
|
+
dateAnswers_1.DateRangeAnswerSchema,
|
|
38
|
+
primitiveAnswers_1.EmailAnswerSchema,
|
|
39
|
+
graphQLAnswers_1.FilteredSearchAnswerSchema,
|
|
40
|
+
primitiveAnswers_1.NumberAnswerSchema,
|
|
41
|
+
optionBasedAnswers_1.RadioButtonsAnswerSchema,
|
|
42
|
+
optionBasedAnswers_1.SelectBoxAnswerSchema,
|
|
43
|
+
tableAnswers_1.TableAnswerSchema,
|
|
44
|
+
primitiveAnswers_1.TextAnswerSchema,
|
|
45
|
+
primitiveAnswers_1.TextAreaAnswerSchema,
|
|
46
|
+
graphQLAnswers_1.TypeaheadSearchAnswerSchema,
|
|
47
|
+
primitiveAnswers_1.URLAnswerSchema
|
|
48
48
|
]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const CheckboxesAnswerSchema: z.ZodObject<{
|
|
3
3
|
meta: z.ZodObject<{
|
|
4
4
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
5
5
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -23,7 +23,7 @@ export declare const CheckboxesAnswer: z.ZodObject<{
|
|
|
23
23
|
};
|
|
24
24
|
answer: string[];
|
|
25
25
|
}>;
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const RadioButtonsAnswerSchema: z.ZodObject<{
|
|
27
27
|
meta: z.ZodObject<{
|
|
28
28
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
29
29
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -47,7 +47,7 @@ export declare const RadioButtonsAnswer: z.ZodObject<{
|
|
|
47
47
|
};
|
|
48
48
|
answer: string;
|
|
49
49
|
}>;
|
|
50
|
-
export declare const
|
|
50
|
+
export declare const SelectBoxAnswerSchema: z.ZodObject<{
|
|
51
51
|
meta: z.ZodObject<{
|
|
52
52
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
53
53
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -71,6 +71,6 @@ export declare const SelectBoxAnswer: z.ZodObject<{
|
|
|
71
71
|
};
|
|
72
72
|
answer: string[];
|
|
73
73
|
}>;
|
|
74
|
-
export type CheckboxesAnswerType = z.infer<typeof
|
|
75
|
-
export type RadioButtonsAnswerType = z.infer<typeof
|
|
76
|
-
export type SelectBoxAnswerType = z.infer<typeof
|
|
74
|
+
export type CheckboxesAnswerType = z.infer<typeof CheckboxesAnswerSchema>;
|
|
75
|
+
export type RadioButtonsAnswerType = z.infer<typeof RadioButtonsAnswerSchema>;
|
|
76
|
+
export type SelectBoxAnswerType = z.infer<typeof SelectBoxAnswerSchema>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SelectBoxAnswerSchema = exports.RadioButtonsAnswerSchema = exports.CheckboxesAnswerSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const answer_1 = require("./answer");
|
|
6
6
|
// Answers to Option Based Question Types
|
|
7
|
-
exports.
|
|
7
|
+
exports.CheckboxesAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
8
8
|
type: zod_1.z.literal('checkBoxes'), // The type of answer
|
|
9
9
|
answer: zod_1.z.array(zod_1.z.string()) // The answer to the question (array of strings)
|
|
10
10
|
}));
|
|
11
|
-
exports.
|
|
11
|
+
exports.RadioButtonsAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
12
12
|
type: zod_1.z.literal('radioButtons'), // The type of answer
|
|
13
13
|
answer: zod_1.z.string() // The answer to the question (string)
|
|
14
14
|
}));
|
|
15
|
-
exports.
|
|
15
|
+
exports.SelectBoxAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
16
16
|
type: zod_1.z.literal('selectBox'), // The type of answer
|
|
17
17
|
answer: zod_1.z.array(zod_1.z.string()) // The answer to the question (array of strings)
|
|
18
18
|
}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const BooleanAnswerSchema: z.ZodObject<{
|
|
3
3
|
meta: z.ZodObject<{
|
|
4
4
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
5
5
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -23,7 +23,7 @@ export declare const BooleanAnswer: z.ZodObject<{
|
|
|
23
23
|
};
|
|
24
24
|
answer: boolean;
|
|
25
25
|
}>;
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const CurrencyAnswerSchema: z.ZodObject<{
|
|
27
27
|
meta: z.ZodObject<{
|
|
28
28
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
29
29
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -47,7 +47,7 @@ export declare const CurrencyAnswer: z.ZodObject<{
|
|
|
47
47
|
};
|
|
48
48
|
answer: number;
|
|
49
49
|
}>;
|
|
50
|
-
export declare const
|
|
50
|
+
export declare const EmailAnswerSchema: z.ZodObject<{
|
|
51
51
|
meta: z.ZodObject<{
|
|
52
52
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
53
53
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -71,7 +71,7 @@ export declare const EmailAnswer: z.ZodObject<{
|
|
|
71
71
|
};
|
|
72
72
|
answer: string;
|
|
73
73
|
}>;
|
|
74
|
-
export declare const
|
|
74
|
+
export declare const NumberAnswerSchema: z.ZodObject<{
|
|
75
75
|
meta: z.ZodObject<{
|
|
76
76
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
77
77
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -95,7 +95,7 @@ export declare const NumberAnswer: z.ZodObject<{
|
|
|
95
95
|
};
|
|
96
96
|
answer: number;
|
|
97
97
|
}>;
|
|
98
|
-
export declare const
|
|
98
|
+
export declare const TextAnswerSchema: z.ZodObject<{
|
|
99
99
|
meta: z.ZodObject<{
|
|
100
100
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
101
101
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -119,7 +119,7 @@ export declare const TextAnswer: z.ZodObject<{
|
|
|
119
119
|
};
|
|
120
120
|
answer: string;
|
|
121
121
|
}>;
|
|
122
|
-
export declare const
|
|
122
|
+
export declare const TextAreaAnswerSchema: z.ZodObject<{
|
|
123
123
|
meta: z.ZodObject<{
|
|
124
124
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
125
125
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -143,7 +143,7 @@ export declare const TextAreaAnswer: z.ZodObject<{
|
|
|
143
143
|
};
|
|
144
144
|
answer: string;
|
|
145
145
|
}>;
|
|
146
|
-
export declare const
|
|
146
|
+
export declare const URLAnswerSchema: z.ZodObject<{
|
|
147
147
|
meta: z.ZodObject<{
|
|
148
148
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
149
149
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -167,10 +167,10 @@ export declare const URLAnswer: z.ZodObject<{
|
|
|
167
167
|
};
|
|
168
168
|
answer: string;
|
|
169
169
|
}>;
|
|
170
|
-
export type BooleanAnswerType = z.infer<typeof
|
|
171
|
-
export type CurrencyAnswerType = z.infer<typeof
|
|
172
|
-
export type EmailAnswerType = z.infer<typeof
|
|
173
|
-
export type NumberAnswerType = z.infer<typeof
|
|
174
|
-
export type TextAnswerType = z.infer<typeof
|
|
175
|
-
export type TextAreaAnswerType = z.infer<typeof
|
|
176
|
-
export type URLAnswerType = z.infer<typeof
|
|
170
|
+
export type BooleanAnswerType = z.infer<typeof BooleanAnswerSchema>;
|
|
171
|
+
export type CurrencyAnswerType = z.infer<typeof CurrencyAnswerSchema>;
|
|
172
|
+
export type EmailAnswerType = z.infer<typeof EmailAnswerSchema>;
|
|
173
|
+
export type NumberAnswerType = z.infer<typeof NumberAnswerSchema>;
|
|
174
|
+
export type TextAnswerType = z.infer<typeof TextAnswerSchema>;
|
|
175
|
+
export type TextAreaAnswerType = z.infer<typeof TextAreaAnswerSchema>;
|
|
176
|
+
export type URLAnswerType = z.infer<typeof URLAnswerSchema>;
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.URLAnswerSchema = exports.TextAreaAnswerSchema = exports.TextAnswerSchema = exports.NumberAnswerSchema = exports.EmailAnswerSchema = exports.CurrencyAnswerSchema = exports.BooleanAnswerSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const answer_1 = require("./answer");
|
|
6
6
|
// Answers to Primitive Question Types
|
|
7
|
-
exports.
|
|
7
|
+
exports.BooleanAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
8
8
|
type: zod_1.z.literal('boolean'), // The type of answer
|
|
9
9
|
answer: zod_1.z.boolean() // The answer to the question (true/false)
|
|
10
10
|
}));
|
|
11
|
-
exports.
|
|
11
|
+
exports.CurrencyAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
12
12
|
type: zod_1.z.literal('currency'), // The type of answer
|
|
13
13
|
answer: zod_1.z.number() // The answer to the question (number)
|
|
14
14
|
}));
|
|
15
|
-
exports.
|
|
15
|
+
exports.EmailAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
16
16
|
type: zod_1.z.literal('email'), // The type of question
|
|
17
17
|
answer: zod_1.z.string() // The answer to the question (string)
|
|
18
18
|
}));
|
|
19
|
-
exports.
|
|
19
|
+
exports.NumberAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
20
20
|
type: zod_1.z.literal('number'), // The type of answer
|
|
21
21
|
answer: zod_1.z.number() // The answer to the question (number)
|
|
22
22
|
}));
|
|
23
|
-
exports.
|
|
23
|
+
exports.TextAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
24
24
|
type: zod_1.z.literal('text'), // The type of answer
|
|
25
25
|
answer: zod_1.z.string() // The answer to the question (string)
|
|
26
26
|
}));
|
|
27
|
-
exports.
|
|
27
|
+
exports.TextAreaAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
28
28
|
type: zod_1.z.literal('textArea'), // The type of answer
|
|
29
29
|
answer: zod_1.z.string() // The answer to the question (string)
|
|
30
30
|
}));
|
|
31
|
-
exports.
|
|
31
|
+
exports.URLAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
32
32
|
type: zod_1.z.literal('url'), // The type of answer
|
|
33
33
|
answer: zod_1.z.string() // The answer to the question (string)
|
|
34
34
|
}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const AnyTableColumnAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
3
3
|
meta: z.ZodObject<{
|
|
4
4
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
5
5
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -337,7 +337,7 @@ export declare const AnyTableColumnAnswer: z.ZodDiscriminatedUnion<"type", [z.Zo
|
|
|
337
337
|
};
|
|
338
338
|
answer: string;
|
|
339
339
|
}>]>;
|
|
340
|
-
export declare const
|
|
340
|
+
export declare const TableAnswerSchema: z.ZodObject<{
|
|
341
341
|
meta: z.ZodObject<{
|
|
342
342
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
343
343
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -872,5 +872,5 @@ export declare const TableAnswer: z.ZodObject<{
|
|
|
872
872
|
answer: string;
|
|
873
873
|
})[];
|
|
874
874
|
}>;
|
|
875
|
-
export type TableAnswerType = z.infer<typeof
|
|
876
|
-
export type AnyTableColumnAnswerType = z.infer<typeof
|
|
875
|
+
export type TableAnswerType = z.infer<typeof TableAnswerSchema>;
|
|
876
|
+
export type AnyTableColumnAnswerType = z.infer<typeof AnyTableColumnAnswerSchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TableAnswerSchema = exports.AnyTableColumnAnswerSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const answer_1 = require("./answer");
|
|
6
6
|
const optionBasedAnswers_1 = require("./optionBasedAnswers");
|
|
@@ -8,24 +8,24 @@ const dateAnswers_1 = require("./dateAnswers");
|
|
|
8
8
|
const graphQLAnswers_1 = require("./graphQLAnswers");
|
|
9
9
|
const primitiveAnswers_1 = require("./primitiveAnswers");
|
|
10
10
|
// Answers to Table Column Question Types (note that TableAnswer is not included here because we don't allow nested tables)
|
|
11
|
-
exports.
|
|
12
|
-
primitiveAnswers_1.
|
|
13
|
-
optionBasedAnswers_1.
|
|
14
|
-
primitiveAnswers_1.
|
|
15
|
-
dateAnswers_1.
|
|
16
|
-
dateAnswers_1.
|
|
17
|
-
primitiveAnswers_1.
|
|
18
|
-
graphQLAnswers_1.
|
|
19
|
-
primitiveAnswers_1.
|
|
20
|
-
optionBasedAnswers_1.
|
|
21
|
-
optionBasedAnswers_1.
|
|
22
|
-
primitiveAnswers_1.
|
|
23
|
-
primitiveAnswers_1.
|
|
24
|
-
graphQLAnswers_1.
|
|
25
|
-
primitiveAnswers_1.
|
|
11
|
+
exports.AnyTableColumnAnswerSchema = zod_1.z.discriminatedUnion('type', [
|
|
12
|
+
primitiveAnswers_1.BooleanAnswerSchema,
|
|
13
|
+
optionBasedAnswers_1.CheckboxesAnswerSchema,
|
|
14
|
+
primitiveAnswers_1.CurrencyAnswerSchema,
|
|
15
|
+
dateAnswers_1.DatePickerAnswerSchema,
|
|
16
|
+
dateAnswers_1.DateRangeAnswerSchema,
|
|
17
|
+
primitiveAnswers_1.EmailAnswerSchema,
|
|
18
|
+
graphQLAnswers_1.FilteredSearchAnswerSchema,
|
|
19
|
+
primitiveAnswers_1.NumberAnswerSchema,
|
|
20
|
+
optionBasedAnswers_1.RadioButtonsAnswerSchema,
|
|
21
|
+
optionBasedAnswers_1.SelectBoxAnswerSchema,
|
|
22
|
+
primitiveAnswers_1.TextAnswerSchema,
|
|
23
|
+
primitiveAnswers_1.TextAreaAnswerSchema,
|
|
24
|
+
graphQLAnswers_1.TypeaheadSearchAnswerSchema,
|
|
25
|
+
primitiveAnswers_1.URLAnswerSchema
|
|
26
26
|
]);
|
|
27
27
|
// Answers to Table Question Types
|
|
28
|
-
exports.
|
|
28
|
+
exports.TableAnswerSchema = answer_1.AnswerSchema.merge(zod_1.z.object({
|
|
29
29
|
type: zod_1.z.literal('table'), // The type of answer
|
|
30
|
-
answer: zod_1.z.array(exports.
|
|
30
|
+
answer: zod_1.z.array(exports.AnyTableColumnAnswerSchema) // The answer to the question (array of answers)
|
|
31
31
|
}));
|
|
@@ -14,7 +14,7 @@ describe("DatePickerQuestion", () => {
|
|
|
14
14
|
schemaVersion: "1.0"
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
expect(() => dateQuestions_1.
|
|
17
|
+
expect(() => dateQuestions_1.DatePickerQuestionSchema.parse(validDatePicker)).not.toThrow();
|
|
18
18
|
});
|
|
19
19
|
it("should throw an error for an invalid DatePickerQuestion object", () => {
|
|
20
20
|
const invalidDatePicker = {
|
|
@@ -28,7 +28,7 @@ describe("DatePickerQuestion", () => {
|
|
|
28
28
|
schemaVersion: "1.0"
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
expect(() => dateQuestions_1.
|
|
31
|
+
expect(() => dateQuestions_1.DatePickerQuestionSchema.parse(invalidDatePicker)).toThrow();
|
|
32
32
|
});
|
|
33
33
|
it("should allow optional attributes in DatePickerQuestion", () => {
|
|
34
34
|
const validDatePicker = {
|
|
@@ -38,7 +38,7 @@ describe("DatePickerQuestion", () => {
|
|
|
38
38
|
schemaVersion: "1.0"
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
expect(() => dateQuestions_1.
|
|
41
|
+
expect(() => dateQuestions_1.DatePickerQuestionSchema.parse(validDatePicker)).not.toThrow();
|
|
42
42
|
});
|
|
43
43
|
});
|
|
44
44
|
describe("DateRangeQuestion", () => {
|
|
@@ -75,7 +75,7 @@ describe("DateRangeQuestion", () => {
|
|
|
75
75
|
schemaVersion: "1.0"
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
|
-
expect(() => dateQuestions_1.
|
|
78
|
+
expect(() => dateQuestions_1.DateRangeQuestionSchema.parse(validDateRange)).not.toThrow();
|
|
79
79
|
});
|
|
80
80
|
it("should throw an error for an invalid DateRangeQuestion object", () => {
|
|
81
81
|
const invalidDateRange = {
|
|
@@ -110,7 +110,7 @@ describe("DateRangeQuestion", () => {
|
|
|
110
110
|
schemaVersion: "1.0"
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
|
-
expect(() => dateQuestions_1.
|
|
113
|
+
expect(() => dateQuestions_1.DateRangeQuestionSchema.parse(invalidDateRange)).toThrow();
|
|
114
114
|
});
|
|
115
115
|
it("should require labels for start and end date pickers", () => {
|
|
116
116
|
const invalidDateRange = {
|
|
@@ -144,6 +144,6 @@ describe("DateRangeQuestion", () => {
|
|
|
144
144
|
schemaVersion: "1.0"
|
|
145
145
|
}
|
|
146
146
|
};
|
|
147
|
-
expect(() => dateQuestions_1.
|
|
147
|
+
expect(() => dateQuestions_1.DateRangeQuestionSchema.parse(invalidDateRange)).toThrow();
|
|
148
148
|
});
|
|
149
149
|
});
|