Skip to content

Commit

Permalink
i hope this is it!
Browse files Browse the repository at this point in the history
  • Loading branch information
stephmilovic committed Jun 15, 2023
1 parent fcf019a commit 1101190
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ const defaultConfig = { apiProvider: 'OpenAI' };
// eslint-disable-next-line import/no-default-export
export default function genAiTest({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
const objectRemover = new ObjectRemover(supertest);
const supertestWithoutAuth = getService('supertestWithoutAuth');
const configService = getService('config');
const retry = getService('retry');

const createConnector = async (apiUrl: string, spaceId?: string) => {
const { body } = await supertest
.post(`${getUrlPrefix(spaceId ?? 'default')}/api/actions/connector`)
Expand All @@ -41,11 +41,15 @@ export default function genAiTest({ getService }: FtrProviderContext) {
})
.expect(200);

objectRemover.add(spaceId ?? 'default', body.id, 'connector', 'actions');

return body.id;
};

describe('GenAi', () => {
const objectRemover = new ObjectRemover(supertest);
after(() => {
objectRemover.removeAll();
});
describe('action creation', () => {
const simulator = new GenAiSimulator({
returnError: false,
Expand Down Expand Up @@ -277,9 +281,6 @@ export default function genAiTest({ getService }: FtrProviderContext) {
});
describe('gen ai dashboard', () => {
const dashboardId = 'specific-dashboard-id-default';
after(() => {
objectRemover.removeAll();
});

it('should not create a dashboard when user does not have kibana event log permissions', async () => {
const { body } = await supertestWithoutAuth
Expand Down Expand Up @@ -355,7 +356,6 @@ export default function genAiTest({ getService }: FtrProviderContext) {
genAiActionId = await createConnector(apiUrl, 'space1');
});
after(() => {
objectRemover.removeAll();
simulator.close();
});

Expand Down

0 comments on commit 1101190

Please sign in to comment.