Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test] Enable unit test suite: telemetry_service.test.ts #502

Merged
merged 1 commit into from
Jun 26, 2021
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ jest.mock('moment', () => {
});
});

describe.skip('TelemetryService', () => {
describe('TelemetryService', () => {
// TODO: enable this unit test when fetchTelemtry function is restored
describe.skip('fetchTelemetry', () => {
it('calls expected URL with 20 minutes - now', async () => {
const telemetryService = mockTelemetryService();
Expand All @@ -70,7 +71,7 @@ describe.skip('TelemetryService', () => {
});
});

describe.skip('fetchExample', () => {
describe('fetchExample', () => {
it('calls fetchTelemetry with unencrupted: true', async () => {
const telemetryService = mockTelemetryService();
telemetryService.fetchTelemetry = jest.fn();
Expand All @@ -79,7 +80,7 @@ describe.skip('TelemetryService', () => {
});
});

describe.skip('setOptIn', () => {
describe('setOptIn', () => {
it('does not call the api if canChangeOptInStatus==false', async () => {
const telemetryService = mockTelemetryService({
reportOptInStatusChange: false,
Expand Down Expand Up @@ -183,7 +184,7 @@ describe.skip('TelemetryService', () => {
});
});

describe.skip('getTelemetryUrl', () => {
describe('getTelemetryUrl', () => {
it('should return the config.url parameter', async () => {
const url = 'http://test.com';
const telemetryService = mockTelemetryService({
Expand All @@ -194,7 +195,7 @@ describe.skip('TelemetryService', () => {
});
});

describe.skip('setUserHasSeenNotice', () => {
describe('setUserHasSeenNotice', () => {
it('should hit the API and change the config', async () => {
const telemetryService = mockTelemetryService({
config: { telemetryNotifyUserAboutOptInDefault: undefined, userCanChangeSettings: true },
Expand Down Expand Up @@ -229,7 +230,7 @@ describe.skip('TelemetryService', () => {
});
});

describe.skip('getUserShouldSeeOptInNotice', () => {
describe('getUserShouldSeeOptInNotice', () => {
it('returns whether the user can update the telemetry config (has SavedObjects access)', () => {
const telemetryService = mockTelemetryService({
config: { userCanChangeSettings: undefined },
Expand Down