Skip to content

Commit 7556436

Browse files
authored
[7.x] Lexicographically sort location tags (#54832) (#54867)
* 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
1 parent 7fd3e10 commit 7556436

File tree

4 files changed

+7
-15
lines changed

4 files changed

+7
-15
lines changed

x-pack/legacy/plugins/uptime/public/components/functional/location_map/__tests__/__snapshots__/location_status_tags.test.tsx.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/legacy/plugins/uptime/public/components/functional/location_map/__tests__/location_status_tags.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { MonitorLocation } from '../../../../../common/runtime_types/monitor';
1111
import { LocationStatusTags } from '../';
1212

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

1717
it('renders when there are many location', () => {

x-pack/legacy/plugins/uptime/public/components/functional/location_map/location_status_tags.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ export const LocationStatusTags = ({ locations }: Props) => {
6060
}
6161
});
6262

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

6868
moment.locale('en', {

x-pack/legacy/plugins/uptime/public/components/functional/ping_list/__tests__/__snapshots__/ping_list.test.tsx.snap

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)