Skip to content

Commit

Permalink
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
Browse files Browse the repository at this point in the history
…-ref HEAD~1..HEAD --fix'
  • Loading branch information
kibanamachine committed Jun 29, 2023
1 parent 05f554e commit 6acff75
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions x-pack/test/api_integration/apis/cloud_security_posture/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

import type { SuperTest, Test } from 'supertest';
import { Client } from '@elastic/elasticsearch';
import expect from '@kbn/expect';
import type { IndexDetails } from '@kbn/cloud-security-posture-plugin/common/types';
import { SecurityService } from '../../../../../test/common/services/security/security';
import type { IndexDetails } from '../../../../../x-pack/plugins/cloud_security_posture/common/types';
import expect from '@kbn/expect/expect';

export const deleteIndex = (es: Client, indexToBeDeleted: string[]) => {
Promise.all([
Expand Down Expand Up @@ -144,7 +144,14 @@ export const deleteUser = async (security: SecurityService, userName: string) =>
await security.user.delete(userName);
};

export const assertIndexStatus = (indicesDetails: IndexDetails[], indexName: string, expectedStatus: string) => {
const actualValue = indicesDetails.find((idx) => idx.index === indexName)?.status;
expect(actualValue).to.eql(expectedStatus, `expected ${indexName} to be ${expectedStatus} but got ${actualValue} instead`);
}
export const assertIndexStatus = (
indicesDetails: IndexDetails[],
indexName: string,
expectedStatus: string
) => {
const actualValue = indicesDetails.find((idx) => idx.index === indexName)?.status;
expect(actualValue).to.eql(
expectedStatus,
`expected ${indexName} to be ${expectedStatus} but got ${actualValue} instead`
);
};

0 comments on commit 6acff75

Please sign in to comment.