Skip to content

Commit

Permalink
fix dsn url
Browse files Browse the repository at this point in the history
  • Loading branch information
joemcelroy committed Sep 20, 2022
1 parent 6f9933b commit 8c85aa7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import '../../../__mocks__/shallow_useeffect.mock';

import React from 'react';

import { shallow } from 'enzyme';

import { EuiCodeBlock } from '@elastic/eui';
import {
EuiCodeBlock,
EuiDescriptionListDescription
} from '@elastic/eui';
import { mount } from 'enzyme';

import { AnalyticsCollection } from '../../../../../common/types/analytics';

Expand All @@ -29,7 +31,18 @@ describe('AnalyticsCollectionIntegrate', () => {
});

it('renders', () => {
const wrapper = shallow(<AnalyticsCollectionIntegrate collection={analyticsCollections} />);
const wrapper = mount(<AnalyticsCollectionIntegrate collection={analyticsCollections} />);
expect(wrapper.find(EuiCodeBlock)).toHaveLength(2);
expect(wrapper.find(EuiDescriptionListDescription).get(0)).toMatchInlineSnapshot(`
<EuiDescriptionListDescription>
example
</EuiDescriptionListDescription>
`);

expect(wrapper.find(EuiDescriptionListDescription).get(1)).toMatchInlineSnapshot(`
<EuiDescriptionListDescription>
/analytics/api/collections/example
</EuiDescriptionListDescription>
`);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface AnalyticsCollectionIntegrateProps {
export const AnalyticsCollectionIntegrate: React.FC<AnalyticsCollectionIntegrateProps> = ({
collection,
}) => {
const analyticsDNSUrl = getEnterpriseSearchUrl(`/analytics/${collection.name}`);
const analyticsDNSUrl = getEnterpriseSearchUrl(`/analytics/api/collections/${collection.name}`);
const credentials = [
{
title: i18n.translate(
Expand Down Expand Up @@ -111,9 +111,9 @@ export const AnalyticsCollectionIntegrate: React.FC<AnalyticsCollectionIntegrate
</EuiText>
<EuiSpacer size="s" />
<EuiCodeBlock language="js" isCopyable>
{`window.elasticAnalytics.trackEvent("ResultClick", {
{`window.elasticAnalytics.trackEvent("click", {
title: "Website Analytics",
url: "www.elasitc.co/analytics/website"
url: "www.elastic.co/analytics/overview"
})`}
</EuiCodeBlock>
</>
Expand Down

0 comments on commit 8c85aa7

Please sign in to comment.