-
Notifications
You must be signed in to change notification settings - Fork 8.6k
init on install #263732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
init on install #263732
Changes from all commits
176cf11
52beff2
fb6636c
a624f44
7faec77
106e36e
251316a
6dd06a9
be18d03
f3c459f
28c66c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,18 +7,28 @@ | |||||||||||||
|
|
||||||||||||||
| import { apiTest } from '@kbn/scout-security'; | ||||||||||||||
| import { expect } from '@kbn/scout-security/api'; | ||||||||||||||
| import { PUBLIC_HEADERS, ENTITY_STORE_ROUTES, ENTITY_STORE_TAGS } from '../fixtures/constants'; | ||||||||||||||
| import { FF_ENABLE_ENTITY_STORE_V2 } from '../../../../common'; | ||||||||||||||
| import { | ||||||||||||||
| PUBLIC_HEADERS, | ||||||||||||||
| INTERNAL_HEADERS, | ||||||||||||||
| ENTITY_STORE_ROUTES, | ||||||||||||||
| ENTITY_STORE_TAGS, | ||||||||||||||
| } from '../fixtures/constants'; | ||||||||||||||
| import { FF_ENABLE_ENTITY_STORE_V2, type GetEntityMaintainersResponse } from '../../../../common'; | ||||||||||||||
|
|
||||||||||||||
| apiTest.describe('Entity Store install / update API tests', { tag: ENTITY_STORE_TAGS }, () => { | ||||||||||||||
| let defaultHeaders: Record<string, string>; | ||||||||||||||
| let internalHeaders: Record<string, string>; | ||||||||||||||
|
|
||||||||||||||
| apiTest.beforeAll(async ({ samlAuth }) => { | ||||||||||||||
| const credentials = await samlAuth.asInteractiveUser('admin'); | ||||||||||||||
| defaultHeaders = { | ||||||||||||||
| ...credentials.cookieHeader, | ||||||||||||||
| ...PUBLIC_HEADERS, | ||||||||||||||
| }; | ||||||||||||||
| internalHeaders = { | ||||||||||||||
| ...credentials.cookieHeader, | ||||||||||||||
| ...INTERNAL_HEADERS, | ||||||||||||||
| }; | ||||||||||||||
| }); | ||||||||||||||
|
|
||||||||||||||
| apiTest( | ||||||||||||||
|
|
@@ -35,6 +45,18 @@ apiTest.describe('Entity Store install / update API tests', { tag: ENTITY_STORE_ | |||||||||||||
| }); | ||||||||||||||
| expect(install.statusCode).toBe(201); | ||||||||||||||
|
|
||||||||||||||
| const maintainersResponse = await apiClient.get( | ||||||||||||||
| ENTITY_STORE_ROUTES.internal.ENTITY_MAINTAINERS_GET, | ||||||||||||||
| { | ||||||||||||||
| headers: internalHeaders, | ||||||||||||||
| responseType: 'json', | ||||||||||||||
| } | ||||||||||||||
| ); | ||||||||||||||
| expect(maintainersResponse.statusCode).toBe(200); | ||||||||||||||
| const { maintainers } = maintainersResponse.body as GetEntityMaintainersResponse; | ||||||||||||||
| expect(maintainers.length).toBeGreaterThan(0); | ||||||||||||||
| expect(maintainers.every((m) => m.taskStatus === 'started')).toBe(true); | ||||||||||||||
|
|
||||||||||||||
| const uninstall = await apiClient.post(ENTITY_STORE_ROUTES.public.UNINSTALL, { | ||||||||||||||
| headers: defaultHeaders, | ||||||||||||||
|
Comment on lines
60
to
61
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ⚪ Nit — Validate the response body
Suggested change
Posted via Macroscope — Scout Test Review |
||||||||||||||
| responseType: 'json', | ||||||||||||||
|
|
||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.