Skip to content

Commit

Permalink
[8.16] [ResponseOps] Fix connector test (#208754) (#209058)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.16`:
- [[ResponseOps] Fix connector test
(#208754)](#208754)

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

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

<!--BACKPORT
[{"author":{"name":"Antonio","email":"[email protected]"},"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//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//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//pull/208033","sha":"5a57f40f6708fbb74b5929e7cd3856524825c8b5"}}]}]
BACKPORT-->

Co-authored-by: Antonio <[email protected]>
  • Loading branch information
kibanamachine and adcoelho authored Jan 31, 2025
1 parent a702e9c commit c2c4490
Showing 1 changed file with 12 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit c2c4490

Please sign in to comment.