Skip to content

Commit 143e58b

Browse files
committed
switch shuffle to reverse
1 parent 089e4ec commit 143e58b

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/material/table/table-data-source.spec.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ describe('MatTableDataSource', () => {
1818
let fixture: ComponentFixture<MatSortApp>;
1919
let sort: MatSort;
2020

21-
/** Randomly shuffles the array of data. */
22-
function shuffle(data: any[]) {
23-
return data.slice().sort(() => (Math.random() - 0.5));
24-
}
25-
2621
beforeEach(() => {
2722
fixture = TestBed.createComponent(MatSortApp);
2823
sort = fixture.componentInstance.sort;
@@ -40,8 +35,8 @@ describe('MatTableDataSource', () => {
4035
// Set the active sort to be on the "prop" key
4136
sort.active = 'prop';
4237

43-
const shuffledData = shuffle(data.slice());
44-
const sortedData = dataSource.sortData(shuffledData, sort);
38+
const reversedData = data.slice().reverse();
39+
const sortedData = dataSource.sortData(reversedData, sort);
4540
expect(sortedData).toEqual(data);
4641
}
4742

0 commit comments

Comments
 (0)