[ResponseOps] Fix connector test (#208754)

## Summary

This PR fixes a test introduced in
https://github.com/elastic/kibana/pull/208033
This commit is contained in:
Antonio 2025-01-31 09:11:15 +01:00 committed by GitHub
parent 4d642585dd
commit 5a57f40f67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -302,28 +302,23 @@ export default function deleteConnectorTests({ getService }: FtrProviderContext)
}
it('should delete a connector with an unsupported type', async () => {
const { space, user } = SuperuserAtSpace1;
await kibanaServer.importExport.load(
'x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/fixtures/unsupported_connector_type.json'
'x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/fixtures/unsupported_connector_type.json',
{ space: space.id }
);
const { space, user } = SuperuserAtSpace1;
const { body: createdConnector } = await supertest
.post(`${getUrlPrefix(space.id)}/api/actions/connector`)
.set('kbn-xsrf', 'foo')
.send({
name: 'My Connector',
connector_type_id: 'test.index-record',
config: {
unencrypted: `This value shouldn't get encrypted`,
},
secrets: {
encrypted: 'This value should be encrypted',
},
})
.expect(200);
const res = await supertestWithoutAuth
.get(`${getUrlPrefix(space.id)}/api/actions/connectors`)
.auth(user.username, user.password);
const invalidConnector = res.body.find(
(connector: { connector_type_id: string; id: string }) =>
connector.connector_type_id === '.invalid-type'
);
const response = await supertestWithoutAuth
.delete(`${getUrlPrefix(space.id)}/api/actions/connector/${createdConnector.id}`)
.delete(`${getUrlPrefix(space.id)}/api/actions/connector/${invalidConnector.id}`)
.auth(user.username, user.password)
.set('kbn-xsrf', 'foo');