[8.17] [ResponseOps] Fix connector test (#208754) (#209060)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[ResponseOps] Fix connector test
(#208754)](https://github.com/elastic/kibana/pull/208754)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"Antonio","email":"antonio.coelho@elastic.co"},"sourceCommit":{"committedDate":"2025-01-31T08:11:15Z","message":"[ResponseOps]
Fix connector test (#208754)\n\n## Summary\r\n\r\nThis PR fixes a test
introduced
in\r\nhttps://github.com/elastic/kibana/pull/208033","sha":"5a57f40f6708fbb74b5929e7cd3856524825c8b5","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","backport:prev-major","v9.1.0"],"title":"[ResponseOps]
Fix connector
test","number":208754,"url":"https://github.com/elastic/kibana/pull/208754","mergeCommit":{"message":"[ResponseOps]
Fix connector test (#208754)\n\n## Summary\r\n\r\nThis PR fixes a test
introduced
in\r\nhttps://github.com/elastic/kibana/pull/208033","sha":"5a57f40f6708fbb74b5929e7cd3856524825c8b5"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/208754","number":208754,"mergeCommit":{"message":"[ResponseOps]
Fix connector test (#208754)\n\n## Summary\r\n\r\nThis PR fixes a test
introduced
in\r\nhttps://github.com/elastic/kibana/pull/208033","sha":"5a57f40f6708fbb74b5929e7cd3856524825c8b5"}}]}]
BACKPORT-->

Co-authored-by: Antonio <antonio.coelho@elastic.co>
This commit is contained in:
Kibana Machine 2025-01-31 21:07:57 +11:00 committed by GitHub
parent 310556d64b
commit c9595ceb0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -302,28 +302,23 @@ export default function deleteActionTests({ 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');