@cparra/apex-reflection 2.0.1 → 2.1.0

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.
@@ -294,4 +294,29 @@ describe('Class reflection', () => {
294
294
  expect(result.classes[0].name).toBe('MyClass');
295
295
  expect(result.classes[0].methods.length).toBe(2);
296
296
  });
297
+
298
+ test('Can have members in groups', () => {
299
+ const classBody = `
300
+ public with sharing class MyClass {
301
+ /**
302
+ * @start-group Group Name
303
+ * @description Group Description
304
+ */
305
+ public String Prop1 { get; set; }
306
+ public Integer Prop2 { get; set; }
307
+ /** @end-group */
308
+ }
309
+ `;
310
+
311
+ const result = (reflect(classBody)).typeMirror as ClassMirror;
312
+ expect(result.properties.length).toBe(2);
313
+ expect(result.properties[0].typeReference.type).toBe('String');
314
+ expect(result.properties[0].name).toBe('Prop1');
315
+ expect(result.properties[0].group).toBe('Group Name');
316
+ expect(result.properties[0].groupDescription).toBe('Group Description');
317
+ expect(result.properties[1].typeReference.type).toBe('Integer');
318
+ expect(result.properties[1].name).toBe('Prop2');
319
+ expect(result.properties[1].group).toBe('Group Name');
320
+ expect(result.properties[1].groupDescription).toBe('Group Description');
321
+ });
297
322
  });