Skip to content

Commit

Permalink
[7.x] Lexicographically sort location tags (#54832) (#54867)
Browse files Browse the repository at this point in the history
* Lexicographically sort location tags (#54832)

Sort location tags lexicographically, fixes skipped test by providing a stable, non-time-based sort order

* Update ping list snapshot
  • Loading branch information
andrewvc authored Jan 15, 2020
1 parent 7fd3e10 commit 7556436
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { MonitorLocation } from '../../../../../common/runtime_types/monitor';
import { LocationStatusTags } from '../';

// Failing: https://github.com/elastic/kibana/issues/54818
describe.skip('LocationStatusTags component', () => {
describe('LocationStatusTags component', () => {
let monitorLocations: MonitorLocation[];

it('renders when there are many location', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ export const LocationStatusTags = ({ locations }: Props) => {
}
});

// Sort by recent timestamp
// Sort lexicographically by label
upLocations.sort((a, b) => {
return a.timestamp < b.timestamp ? 1 : b.timestamp < a.timestamp ? -1 : 0;
return a.label > b.label ? 1 : b.label > a.label ? -1 : 0;
});

moment.locale('en', {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7556436

Please sign in to comment.