Use getUrlPartsWithStrippedDefaultPort instead of getUrlParts (#199264)

## Summary

Use getUrlPartsWithStrippedDefaultPort to avoid this
[issue](https://github.com/elastic/kibana/pull/195902#issuecomment-2411667499)
on MKI:

```
Serverless Observability - Deployment-agnostic api integration - Custom Threshold rule AVG - PCT - FIRED Rule creation should set correct action variables

Error: expected '1e0c2d3e-e5c2-4bfe-9df0-d46681253b9f'
to sort of equal '1e0c2d3e-e5c2-4bfe-9df0-d46681253b9f'
```
This commit is contained in:
Maryam Saeidi 2024-11-07 11:45:33 +01:00 committed by GitHub
parent c9d167f1ab
commit 996104f2ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 4 deletions

View file

@ -249,7 +249,7 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) {
docCountTarget: 1,
});
const { protocol, hostname, port } = kbnTestConfig.getUrlParts();
const { protocol, hostname, port } = kbnTestConfig.getUrlPartsWithStrippedDefaultPort();
expect(resp.hits.hits[0]._source?.ruleType).eql('observability.rules.custom_threshold');
expect(resp.hits.hits[0]._source?.alertDetailsUrl).eql(
`${protocol}://${hostname}${port ? `:${port}` : ''}/app/observability/alerts/${alertId}`

View file

@ -247,7 +247,7 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) {
docCountTarget: 1,
});
const { protocol, hostname, port } = kbnTestConfig.getUrlParts();
const { protocol, hostname, port } = kbnTestConfig.getUrlPartsWithStrippedDefaultPort();
expect(resp.hits.hits[0]._source?.ruleType).eql('observability.rules.custom_threshold');
expect(resp.hits.hits[0]._source?.alertDetailsUrl).eql(

View file

@ -272,7 +272,7 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) {
const resp = await alertingApi.waitForDocumentInIndex<ActionDocument>({
indexName: ALERT_ACTION_INDEX,
});
const { protocol, hostname, port } = kbnTestConfig.getUrlParts();
const { protocol, hostname, port } = kbnTestConfig.getUrlPartsWithStrippedDefaultPort();
expect(resp.hits.hits[0]._source?.ruleType).eql('observability.rules.custom_threshold');
expect(resp.hits.hits[0]._source?.alertDetailsUrl).eql(

View file

@ -244,7 +244,7 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) {
docCountTarget: 1,
});
const { protocol, hostname, port } = kbnTestConfig.getUrlParts();
const { protocol, hostname, port } = kbnTestConfig.getUrlPartsWithStrippedDefaultPort();
expect(resp.hits.hits[0]._source?.ruleType).eql('observability.rules.custom_threshold');
expect(resp.hits.hits[0]._source?.alertDetailsUrl).eql(
`${protocol}://${hostname}${port ? `:${port}` : ''}/app/observability/alerts/${alertId}`