Skip to content

Commit

Permalink
fix ent search test
Browse files Browse the repository at this point in the history
  • Loading branch information
sphilipse committed Sep 19, 2024
1 parent cc4f28f commit 42e7e0a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ jest.mock('../../../../shared/enterprise_search_url', () => ({
getEnterpriseSearchUrl: () => 'http://localhost:3002',
}));

jest.mock('../../../../shared/cloud_details/cloud_details', () => ({
useCloudDetails: () => ({
elasticsearchUrl: 'your_deployment_url',
}),
}));

describe('AnalyticsCollectionIntegrate', () => {
const analyticsCollections: AnalyticsCollection = {
events_datastream: 'analytics-events-example',
Expand Down Expand Up @@ -55,7 +61,7 @@ describe('AnalyticsCollectionIntegrate', () => {
.toMatchInlineSnapshot(`
"<script type=\\"text/javascript\\">
window.elasticAnalytics.createTracker({
endpoint: \\"https://localhost:9200\\",
endpoint: \\"your_deployment_url\\",
collectionName: \\"example\\",
apiKey: \\"########\\",
// Optional: sampling rate percentage: 0-1, 0 = no events, 1 = all events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ http.cors.allow-headers: X-Requested-With, X-Auth-Token, Content-Type, Content-L
)}
</p>
<EuiLink
data-test-subj="enterpriseSearchCORSStepLearnMoreAboutCorsForBehavioralAnalyticsLink"
href={docLinks.behavioralAnalyticsCORS}
data-telemetry-id="entSearchContent-analytics-cors-learnMoreLink"
external
Expand Down Expand Up @@ -130,6 +131,7 @@ const apiKeyStep = (
}
)}{' '}
<EuiLink
data-test-subj="enterpriseSearchApiKeyStepLearnMoreAboutApiKeysLink"
href={docLinks.apiKeys}
data-telemetry-id="entSearchContent-analytics-apiKey-learnMoreLink"
external
Expand All @@ -148,6 +150,7 @@ const apiKeyStep = (
<EuiFlexGroup gutterSize="s">
<EuiFlexItem grow={false}>
<EuiButton
data-test-subj="enterpriseSearchApiKeyStepCreateApiKeyButton"
iconSide="left"
iconType="plusInCircleFilled"
onClick={openApiKeyModal}
Expand All @@ -163,6 +166,7 @@ const apiKeyStep = (
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton
data-test-subj="enterpriseSearchApiKeyStepViewKeysButton"
iconSide="left"
iconType="popout"
data-telemetry-id="entSearchContent-analytics-apiKey-viewKeysButton"
Expand Down

0 comments on commit 42e7e0a

Please sign in to comment.