mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
parent
92b89703fb
commit
de6e45241f
2 changed files with 22 additions and 8 deletions
|
@ -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',
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue