|
@@ -96,7 +96,7 @@ describe('navigation options', () => {
|
96
|
96
|
|
97
|
97
|
// As we can't import external images and we don't want to add an image here
|
98
|
98
|
// I assign the icons to strings (what the require would generally look like)
|
99
|
|
- // and expect the value to be resovled, in this case it doesn't find anything and returns null
|
|
99
|
+ // and expect the value to be resolved, in this case it doesn't find anything and returns null
|
100
|
100
|
expect(options.icon).toEqual(null);
|
101
|
101
|
expect(options.topBar.myIcon).toEqual(null);
|
102
|
102
|
expect(options.image).toEqual(null);
|
|
@@ -173,4 +173,38 @@ describe('navigation options', () => {
|
173
|
173
|
|
174
|
174
|
expect(options.someImage).toEqual(undefined);
|
175
|
175
|
});
|
|
176
|
+
|
|
177
|
+ it('omits passProps when processing options', () => {
|
|
178
|
+ const passProps = {
|
|
179
|
+ topBar: {
|
|
180
|
+ rightButtons: [
|
|
181
|
+ {
|
|
182
|
+ passProps: {},
|
|
183
|
+ id: 'btn1'
|
|
184
|
+ },
|
|
185
|
+ ],
|
|
186
|
+ leftButtons: [
|
|
187
|
+ {
|
|
188
|
+ passProps: {},
|
|
189
|
+ id: 'btn2'
|
|
190
|
+ }
|
|
191
|
+ ],
|
|
192
|
+ title: {
|
|
193
|
+ component: {
|
|
194
|
+ passProps: {}
|
|
195
|
+ }
|
|
196
|
+ },
|
|
197
|
+ background: {
|
|
198
|
+ component: {
|
|
199
|
+ passProps: {}
|
|
200
|
+ }
|
|
201
|
+ }
|
|
202
|
+ }
|
|
203
|
+ };
|
|
204
|
+ uut.processOptions(passProps);
|
|
205
|
+ expect(passProps.topBar.rightButtons[0].passProps).toBeUndefined();
|
|
206
|
+ expect(passProps.topBar.leftButtons[0].passProps).toBeUndefined();
|
|
207
|
+ expect(passProps.topBar.title.component.passProps).toBeUndefined();
|
|
208
|
+ expect(passProps.topBar.background.component.passProps).toBeUndefined();
|
|
209
|
+ });
|
176
|
210
|
});
|