mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
test and doc generateSchema
This commit is contained in:
@@ -367,4 +367,17 @@ describe('ObjectDataRow', () => {
|
||||
expect(row.hasValue('some.other.prop')).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should generateSchema generate a schema from data', () => {
|
||||
let data = [
|
||||
{ id: 2, name: 'abs' },
|
||||
{ id: 1, name: 'xyz' }
|
||||
];
|
||||
|
||||
let schema = ObjectDataTableAdapter.generateSchema(data);
|
||||
|
||||
expect(schema.length).toBe(2);
|
||||
expect(schema[0].title).toBe('id');
|
||||
expect(schema[1].title).toBe('name');
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user