Flaky #175531 - sort keys (#190157)

This commit is contained in:
Alejandro Fernández Haro 2024-08-08 22:35:35 +02:00 committed by GitHub
parent 92b89703fb
commit de6e45241f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 8 deletions

View file

@ -12,6 +12,11 @@ import type { Response } from 'supertest';
import { SavedObject } from '@kbn/core/types';
import type { PluginFunctionalProviderContext } from '../../services';
interface MinimalSO {
id: string;
type: string;
}
function parseNdJson(input: string): Array<SavedObject<any>> {
return input.split('\n').map((str) => JSON.parse(str));
}
@ -112,10 +117,12 @@ export default function ({ getService }: PluginFunctionalProviderContext) {
.expect(200)
.then((resp) => {
expect(
resp.body.saved_objects.map((so: { id: string; type: string }) => ({
id: so.id,
type: so.type,
}))
resp.body.saved_objects
.map((so: MinimalSO) => ({
id: so.id,
type: so.type,
}))
.sort((a: MinimalSO, b: MinimalSO) => (a.id > b.id ? 1 : -1))
).to.eql([
{
id: 'hidden-from-http-apis-1',

View file

@ -11,6 +11,11 @@ import type { Response } from 'supertest';
import { SavedObject } from '@kbn/core/types';
import { FtrProviderContext } from '../../../ftr_provider_context';
interface MinimalSO {
id: string;
type: string;
}
function parseNdJson(input: string): Array<SavedObject<any>> {
return input.split('\n').map((str) => JSON.parse(str));
}
@ -118,10 +123,12 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
.expect(200)
.then((resp) => {
expect(
resp.body.saved_objects.map((so: { id: string; type: string }) => ({
id: so.id,
type: so.type,
}))
resp.body.saved_objects
.map((so: MinimalSO) => ({
id: so.id,
type: so.type,
}))
.sort((a: MinimalSO, b: MinimalSO) => (a.id > b.id ? 1 : -1))
).to.eql([
{
id: 'hidden-from-http-apis-1',