Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/settings/telemetry-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Usage Collection (also known as Telemetry) is enabled by default. This allows us
Refer to our https://www.elastic.co/legal/product-privacy-statement[Privacy Statement] to learn more.

You can control whether this data is sent from the {kib} servers, or if it should be sent
from the user's browser, in case a firewall is blocking the connections from the server. Additionally, you can decide to completely disable this feature either in the config file or in {kib} via *Management > Kibana > Advanced Settings > Usage Data*.
from the user's browser, in case a firewall is blocking the connections from the server. Additionally, you can disable this feature either in *Stack Management > {kib} > Advanced Settings > Global Settings > Usage collection* or the config file with the following settings.

[float]
[[telemetry-general-settings]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ export interface ISavedObjectsRepository {
* It will not create a nested structure like:
* `{attributes: {stats: {api: {counter: 1}}}}`
*
* When using incrementCounter for collecting usage data, you need to ensure
* When using incrementCounter you need to ensure
* that usage collection happens on a best-effort basis and doesn't
* negatively affect your plugin or users. See https://github.com/elastic/kibana/blob/main/src/plugins/usage_collection/README.mdx#tracking-interactions-with-incrementcounter)
*
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

65 changes: 0 additions & 65 deletions src/plugins/telemetry/public/components/opt_in_banner.test.tsx

This file was deleted.

54 changes: 0 additions & 54 deletions src/plugins/telemetry/public/components/opt_in_banner.tsx

This file was deleted.

97 changes: 89 additions & 8 deletions src/plugins/telemetry/public/components/opt_in_message.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,97 @@
*/

import React from 'react';
import { shallowWithIntl } from '@kbn/test-jest-helpers';
import type { ReactWrapper } from 'enzyme';
import { mountWithIntl } from '@kbn/test-jest-helpers';
import { httpServiceMock } from '@kbn/core-http-browser-mocks';
import { mockTelemetryConstants, mockTelemetryService } from '../mocks';
import { OptInMessage } from './opt_in_message';
import { mockTelemetryConstants } from '../mocks';

const telemetryConstants = mockTelemetryConstants();

describe('OptInMessage', () => {
it('renders as expected', () => {
expect(
shallowWithIntl(<OptInMessage telemetryConstants={telemetryConstants} />)
).toMatchSnapshot();
const addBasePath = httpServiceMock.createBasePath().prepend;
const telemetryConstants = mockTelemetryConstants();

describe('when opted-in', () => {
const telemetryService = mockTelemetryService({ config: { optIn: true } });

let dom: ReactWrapper;

beforeAll(() => {
dom = mountWithIntl(
<OptInMessage
telemetryConstants={telemetryConstants}
telemetryService={telemetryService}
addBasePath={addBasePath}
/>
);
});

afterAll(() => {
dom.unmount();
});

it('claims that telemetry is enabled', () => {
expect(dom.text()).toContain('Usage collection (also known as Telemetry) is enabled.');
});

it('offers the link to disable it', () => {
expect(dom.text()).toContain('Disable usage collection.');
});
});

describe('when opted-out', () => {
const telemetryService = mockTelemetryService({ config: { optIn: false } });

let dom: ReactWrapper;

beforeAll(() => {
dom = mountWithIntl(
<OptInMessage
telemetryConstants={telemetryConstants}
telemetryService={telemetryService}
addBasePath={addBasePath}
/>
);
});

afterAll(() => {
dom.unmount();
});

it('claims that telemetry is disabled', () => {
expect(dom.text()).toContain('Usage collection (also known as Telemetry) is disabled.');
});

it('offers the link to enable it', () => {
expect(dom.text()).toContain('Enable usage collection.');
});
});

describe('when null', () => {
const telemetryService = mockTelemetryService({ config: { optIn: null } });

let dom: ReactWrapper;

beforeAll(() => {
dom = mountWithIntl(
<OptInMessage
telemetryConstants={telemetryConstants}
telemetryService={telemetryService}
addBasePath={addBasePath}
/>
);
});

afterAll(() => {
dom.unmount();
});

it('claims that telemetry is disabled', () => {
expect(dom.text()).toContain('Usage collection (also known as Telemetry) is disabled.');
});

it('offers the link to enable it', () => {
expect(dom.text()).toContain('Enable usage collection.');
});
});
});
Loading