kibana/test/api_integration/apis/guided_onboarding/get_guides.ts
Sander Philipse 2ba56a55a4
[9.0] [Search] Remove website search guided onboarding (#224538) (#224665)
# Backport

This will backport the following commits from `main` to `9.0`:
- [[Search] Remove website search guided onboarding
(#224538)](https://github.com/elastic/kibana/pull/224538)

<!--- Backport version: 10.0.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Sander
Philipse","email":"94373878+sphilipse@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-06-19T17:34:32Z","message":"[Search]
Remove website search guided onboarding (#224538)\n\n## Summary\n\nThis
removes the deprecated website search guided onboarding from\nKibana.
Deprecated because we no longer offer a managed web
crawler.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"9171743e8368a47503cf5892a8b7e47d35b42319","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Search","backport:prev-minor","v9.1.0","v9.0.1"],"title":"[Search]
Remove website search guided
onboarding","number":224538,"url":"https://github.com/elastic/kibana/pull/224538","mergeCommit":{"message":"[Search]
Remove website search guided onboarding (#224538)\n\n## Summary\n\nThis
removes the deprecated website search guided onboarding from\nKibana.
Deprecated because we no longer offer a managed web
crawler.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"9171743e8368a47503cf5892a8b7e47d35b42319"}},"sourceBranch":"main","suggestedTargetBranches":["9.0"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224538","number":224538,"mergeCommit":{"message":"[Search]
Remove website search guided onboarding (#224538)\n\n## Summary\n\nThis
removes the deprecated website search guided onboarding from\nKibana.
Deprecated because we no longer offer a managed web
crawler.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"9171743e8368a47503cf5892a8b7e47d35b42319"}},{"branch":"9.0","label":"v9.0.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-20 08:07:25 -05:00

53 lines
2.2 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import expect from '@kbn/expect';
import { testGuideStep1ActiveState } from '@kbn/guided-onboarding-plugin/public/services/api.mocks';
import {
guideStateSavedObjectsType,
pluginStateSavedObjectsType,
} from '@kbn/guided-onboarding-plugin/server/saved_objects/guided_setup';
import { API_BASE_PATH } from '@kbn/guided-onboarding-plugin/common';
import { X_ELASTIC_INTERNAL_ORIGIN_REQUEST } from '@kbn/core-http-common';
import type { FtrProviderContext } from '../../ftr_provider_context';
import { createGuides } from './helpers';
const getGuidesPath = `${API_BASE_PATH}/guides`;
export default function testGetGuidesState({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer');
describe(`GET ${getGuidesPath}`, () => {
afterEach(async () => {
// Clean up saved objects
await kibanaServer.savedObjects.clean({
types: [guideStateSavedObjectsType, pluginStateSavedObjectsType],
});
});
it('returns an empty array if no guides', async () => {
const response = await supertest
.get(getGuidesPath)
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.expect(200);
expect(response.body).not.to.be.empty();
expect(response.body.state).to.be.empty();
});
it('returns all created guides (active and inactive)', async () => {
await createGuides(kibanaServer, [testGuideStep1ActiveState]);
const response = await supertest
.get(getGuidesPath)
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.expect(200);
expect(response.body).not.to.be.empty();
expect(response.body.state).to.eql([testGuideStep1ActiveState]);
});
});
}