mirror of
https://github.com/nasa/openmct.git
synced 2025-06-12 20:28:14 +00:00
Merged
Resolved merge conflicts Resolved merge conflicts
This commit is contained in:
@ -118,7 +118,7 @@ define(
|
||||
});
|
||||
|
||||
it('Sets rows on scope when rows change', function() {
|
||||
controller.updateRows(testRows);
|
||||
controller.setRows(testRows);
|
||||
expect(mockScope.displayRows.length).toBe(3);
|
||||
expect(mockScope.displayRows).toEqual(testRows);
|
||||
});
|
||||
@ -130,7 +130,7 @@ define(
|
||||
'col2': {'text': 'ghi'},
|
||||
'col3': {'text': 'row3 col3'}
|
||||
};
|
||||
controller.updateRows(testRows);
|
||||
controller.setRows(testRows);
|
||||
expect(mockScope.displayRows.length).toBe(3);
|
||||
testRows.push(row4);
|
||||
addRowFunc(undefined, 3);
|
||||
@ -139,7 +139,7 @@ define(
|
||||
|
||||
it('Supports removing rows individually', function() {
|
||||
var removeRowFunc = mockScope.$on.calls[mockScope.$on.calls.length-1].args[1];
|
||||
controller.updateRows(testRows);
|
||||
controller.setRows(testRows);
|
||||
expect(mockScope.displayRows.length).toBe(3);
|
||||
removeRowFunc(undefined, 2);
|
||||
expect(mockScope.displayRows.length).toBe(2);
|
||||
@ -211,20 +211,20 @@ define(
|
||||
mockScope.displayRows = controller.sortRows(testRows.slice(0));
|
||||
|
||||
mockScope.rows.push(row4);
|
||||
controller.newRow(undefined, mockScope.rows.length-1);
|
||||
controller.addRow(undefined, mockScope.rows.length-1);
|
||||
expect(mockScope.displayRows[0].col2.text).toEqual('xyz');
|
||||
|
||||
mockScope.rows.push(row5);
|
||||
controller.newRow(undefined, mockScope.rows.length-1);
|
||||
controller.addRow(undefined, mockScope.rows.length-1);
|
||||
expect(mockScope.displayRows[4].col2.text).toEqual('aaa');
|
||||
|
||||
mockScope.rows.push(row6);
|
||||
controller.newRow(undefined, mockScope.rows.length-1);
|
||||
controller.addRow(undefined, mockScope.rows.length-1);
|
||||
expect(mockScope.displayRows[2].col2.text).toEqual('ggg');
|
||||
|
||||
//Add a duplicate row
|
||||
mockScope.rows.push(row6);
|
||||
controller.newRow(undefined, mockScope.rows.length-1);
|
||||
controller.addRow(undefined, mockScope.rows.length-1);
|
||||
expect(mockScope.displayRows[2].col2.text).toEqual('ggg');
|
||||
expect(mockScope.displayRows[3].col2.text).toEqual('ggg');
|
||||
});
|
||||
@ -240,12 +240,12 @@ define(
|
||||
mockScope.displayRows = controller.filterRows(testRows);
|
||||
|
||||
mockScope.rows.push(row5);
|
||||
controller.newRow(undefined, mockScope.rows.length-1);
|
||||
controller.addRow(undefined, mockScope.rows.length-1);
|
||||
expect(mockScope.displayRows.length).toBe(2);
|
||||
expect(mockScope.displayRows[1].col2.text).toEqual('aaa');
|
||||
|
||||
mockScope.rows.push(row6);
|
||||
controller.newRow(undefined, mockScope.rows.length-1);
|
||||
controller.addRow(undefined, mockScope.rows.length-1);
|
||||
expect(mockScope.displayRows.length).toBe(2);
|
||||
//Row was not added because does not match filter
|
||||
});
|
||||
@ -259,11 +259,11 @@ define(
|
||||
mockScope.displayRows = testRows.slice(0);
|
||||
|
||||
mockScope.rows.push(row5);
|
||||
controller.newRow(undefined, mockScope.rows.length-1);
|
||||
controller.addRow(undefined, mockScope.rows.length-1);
|
||||
expect(mockScope.displayRows[3].col2.text).toEqual('aaa');
|
||||
|
||||
mockScope.rows.push(row6);
|
||||
controller.newRow(undefined, mockScope.rows.length-1);
|
||||
controller.addRow(undefined, mockScope.rows.length-1);
|
||||
expect(mockScope.displayRows[4].col2.text).toEqual('ggg');
|
||||
});
|
||||
|
||||
@ -282,7 +282,7 @@ define(
|
||||
mockScope.displayRows = testRows.slice(0);
|
||||
|
||||
mockScope.rows.push(row7);
|
||||
controller.newRow(undefined, mockScope.rows.length-1);
|
||||
controller.addRow(undefined, mockScope.rows.length-1);
|
||||
expect(controller.$scope.sizingRow.col2).toEqual({text: 'some longer string'});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user