From 59b292ffd6dffee36ed323c347034078e0f8f5c1 Mon Sep 17 00:00:00 2001 From: Lee Drengenberg Date: Mon, 14 Mar 2022 16:26:25 -0500 Subject: [PATCH] backport just this method from https://github.com/elastic/kibana/pull/127508 (#127656) --- .../kbn_client/kbn_client_saved_objects.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/kbn-test/src/kbn_client/kbn_client_saved_objects.ts b/packages/kbn-test/src/kbn_client/kbn_client_saved_objects.ts index 904ccc385bd7d..a9d677ac5a5f1 100644 --- a/packages/kbn-test/src/kbn_client/kbn_client_saved_objects.ts +++ b/packages/kbn-test/src/kbn_client/kbn_client_saved_objects.ts @@ -214,6 +214,25 @@ export class KbnClientSavedObjects { this.log.success('deleted', deleted, 'objects'); } + public async cleanStandardList(options?: { space?: string }) { + // add types here + const types = [ + 'search', + 'index-pattern', + 'visualization', + 'dashboard', + 'lens', + 'map', + 'graph-workspace', + 'query', + 'tag', + 'url', + 'canvas-workpad', + ]; + const newOptions = { types, space: options?.space }; + await this.clean(newOptions); + } + public async bulkDelete(options: DeleteObjectsOptions) { let deleted = 0; let missing = 0;