Skip to content

Commit

Permalink
Lexicographically sort location tags (elastic#54832)
Browse files Browse the repository at this point in the history
Sort location tags lexicographically, fixes skipped test by providing a stable, non-time-based sort order
  • Loading branch information
andrewvc authored and jkelastic committed Jan 17, 2020
1 parent 7a33ca9 commit ca5e2bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 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 properly against props', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,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.updateLocale('en', {
Expand Down

0 comments on commit ca5e2bd

Please sign in to comment.