mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[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:
parent
4d642585dd
commit
5a57f40f67
1 changed files with 12 additions and 17 deletions
|
@ -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');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue