Skip to content

Commit

Permalink
Fixed issue with sorting by title
Browse files Browse the repository at this point in the history
  • Loading branch information
Hargne committed Mar 24, 2020
1 parent 1ed1ce8 commit fb12a1a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/sorting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,18 @@ const sortByTitleDesc = (testResults: AggregatedResult["testResults"]) => {
);
// Sort Suite testResults
sorted.forEach(suite => {
// By Ancestor Titles
suite.testResults.sort((a, b) =>
sortAlphabetically(
a.ancestorTitles.join(" "),
b.ancestorTitles.join(" "),
true
)
);
// By Test Titles
suite.testResults.sort((a, b) =>
sortAlphabetically(a.title, b.title, true)
);
});
return sorted;
}
Expand All @@ -136,12 +141,15 @@ const sortByTitleAsc = (testResults: AggregatedResult["testResults"]) => {
);
// Sort Suite testResults
sorted.forEach(suite => {
// By Ancestor Titles
suite.testResults.sort((a, b) =>
sortAlphabetically(
a.ancestorTitles.join(" "),
b.ancestorTitles.join(" ")
)
);
// By Test Titles
suite.testResults.sort((a, b) => sortAlphabetically(a.title, b.title));
});
return sorted;
}
Expand Down

0 comments on commit fb12a1a

Please sign in to comment.