/
Subscription.spec.ts.snap
147 lines (123 loc) · 5 KB
/
Subscription.spec.ts.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Subscription isSubscription should recognize non-Subscription objects 1`] = `"Not a Subscription object"`;
exports[`Subscription postProcessor should pass through postProcessor if it is declared 1`] = `
Subscription {
"attributes": Array [
"someAttribute",
],
"delimiter": "/",
"description": "build item",
"ignoreRequired": true,
"isTypeCreate": true,
"name": "SomeSubWithPostProcessor",
"postProcessor": [Function],
"type": "onCreate",
}
`;
exports[`Subscription postProcessor should pass through postProcessor if it is declared: withPostProcessorEnd 1`] = `
Object {
"done": true,
"value": undefined,
}
`;
exports[`Subscription postProcessor should pass through postProcessor if it is declared: withPostProcessorResult 1`] = `
Object {
"done": false,
"value": Object {
"data": Object {
"someSubWithPostProcessorSomeTestsEntityName": Object {
"someTestsEntityName": Object {
"anotherAttribute": "earth",
},
},
},
},
}
`;
exports[`Subscription postProcessor should pass through postProcessor if it is declared: withoutPostProcessorEnd 1`] = `
Object {
"done": true,
"value": undefined,
}
`;
exports[`Subscription postProcessor should pass through postProcessor if it is declared: withoutPostProcessorResult 1`] = `
Object {
"done": false,
"value": Object {
"data": Object {
"someSubWithPostProcessorSomeTestsEntityName": Object {
"someTestsEntityName": Object {
"anotherAttribute": "world",
},
},
},
},
}
`;
exports[`Subscription preProcessor should pass through preProcessor if it is declared 1`] = `
Subscription {
"attributes": Array [
"someAttribute",
],
"delimiter": "/",
"description": "build item",
"ignoreRequired": true,
"isTypeCreate": true,
"name": "SomeSubWithPreProcessor",
"preProcessor": [Function],
"type": "onCreate",
}
`;
exports[`Subscription preProcessor should pass through preProcessor if it is declared: withPreProcessorEnd 1`] = `
Object {
"done": true,
"value": undefined,
}
`;
exports[`Subscription preProcessor should pass through preProcessor if it is declared: withPreProcessorResult 1`] = `
Object {
"done": false,
"value": Object {
"data": Object {
"someSubWithPreProcessorSomeTestsEntityName": Object {
"someTestsEntityName": Object {
"anotherAttribute": "world",
},
},
},
},
}
`;
exports[`Subscription preProcessor should pass through preProcessor if it is declared: withoutPreProcessorEnd 1`] = `
Object {
"done": true,
"value": undefined,
}
`;
exports[`Subscription preProcessor should pass through preProcessor if it is declared: withoutPreProcessorResult 1`] = `
Object {
"done": false,
"value": Object {
"data": Object {
"someSubWithPreProcessorSomeTestsEntityName": Object {
"someTestsEntityName": Object {
"anotherAttribute": "world",
},
},
},
},
}
`;
exports[`Subscription processEntitySubscriptions should throw if provided with an invalid list of subscriptions 1`] = `"Entity 'SomeEntityName' subscriptions definition needs to be an array of subscriptions"`;
exports[`Subscription processEntitySubscriptions should throw if provided with an invalid subscription 1`] = `"Invalid subscription definition for entity 'SomeEntityName' at position '0'"`;
exports[`Subscription processEntitySubscriptions should throw if required attribute is missing in CREATE type subscriptions 1`] = `"Missing required attributes in subscription 'SomeEntityName.onBuild' need to have a defaultValue() function: [ neededAttribute ]"`;
exports[`Subscription processEntitySubscriptions should throw if unknown attributes are used 1`] = `"Cannot use attribute 'SomeEntityName.doesNotExist' in subscription 'SomeEntityName.onBuild' as it does not exist"`;
exports[`Subscription processEntitySubscriptions should throw on duplicate subscription names 1`] = `"Duplicate subscription name 'onBuild' found in 'SomeEntityName'"`;
exports[`Subscription should have a description 1`] = `"Missing description for subscription 'example'"`;
exports[`Subscription should have a list of unique attribute names 1`] = `"Subscription 'SomeEntityName.example' needs to have a list of unique attribute names"`;
exports[`Subscription should have a list of valid attribute names 1`] = `"Subscription 'SomeEntityName.example' needs to have a list of attribute names"`;
exports[`Subscription should have a name 1`] = `"Missing subscription name"`;
exports[`Subscription should have a type 1`] = `"Missing type for subscription 'example'"`;
exports[`Subscription should have a valid postProcessor function 1`] = `"postProcessor of subscription 'example' needs to be a valid function"`;
exports[`Subscription should have a valid preProcessor function 1`] = `"preProcessor of subscription 'example' needs to be a valid function"`;
exports[`Subscription should have a valid type 1`] = `"Unknown subscription type '12346' used, try one of these: 'onCreate, onUpdate, onDelete'"`;