mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3131] fix selection order for DT/DL (#3433)
* fix selection order for DT/DL * remove fit
This commit is contained in:
committed by
Eugenio Romano
parent
465a2d090d
commit
35d2a0b683
@@ -52,6 +52,24 @@ describe('DataTable', () => {
|
||||
fixture.destroy();
|
||||
});
|
||||
|
||||
it('should preserve the top-to-bottom selection order', () => {
|
||||
dataTable.data = new ObjectDataTableAdapter(
|
||||
[{ id: 1 }, { id: 2 }, { id: 3 }],
|
||||
[ new ObjectDataColumn({ key: 'id' })]
|
||||
);
|
||||
|
||||
const rows = dataTable.data.getRows();
|
||||
|
||||
dataTable.selectRow(rows[2], true);
|
||||
dataTable.selectRow(rows[0], true);
|
||||
dataTable.selectRow(rows[1], true);
|
||||
|
||||
const selection = dataTable.selection;
|
||||
expect(selection[0].getValue('id')).toBe(1);
|
||||
expect(selection[1].getValue('id')).toBe(2);
|
||||
expect(selection[2].getValue('id')).toBe(3);
|
||||
});
|
||||
|
||||
it('should update schema if columns change', fakeAsync(() => {
|
||||
|
||||
dataTable.columnList = new DataColumnListComponent();
|
||||
|
Reference in New Issue
Block a user