From f2b513bd57f0049c2fce11cb1d6167ed462f23b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Ferna=CC=81ndez=20Haro?= Date: Tue, 27 Apr 2021 14:36:32 +0200 Subject: [PATCH] Fix telemetry_management_section tests --- ...telemetry_management_section.test.tsx.snap | 20 +++++++++++++++++-- .../telemetry_management_section.test.tsx | 12 +++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/plugins/telemetry_management_section/public/components/__snapshots__/telemetry_management_section.test.tsx.snap b/src/plugins/telemetry_management_section/public/components/__snapshots__/telemetry_management_section.test.tsx.snap index 896b1671328a9..e0ba7e7527af7 100644 --- a/src/plugins/telemetry_management_section/public/components/__snapshots__/telemetry_management_section.test.tsx.snap +++ b/src/plugins/telemetry_management_section/public/components/__snapshots__/telemetry_management_section.test.tsx.snap @@ -95,13 +95,14 @@ exports[`TelemetryManagementSectionComponent renders as expected 1`] = ` size="s" />

@@ -156,12 +157,26 @@ exports[`TelemetryManagementSectionComponent renders as expected 1`] = `

, "displayName": "Provide usage statistics", + "isCustom": true, + "isOverridden": false, "name": "telemetry:enabled", + "requiresPageReload": false, "type": "boolean", "value": true, } } - toasts={null} + toasts={ + Object { + "add": [MockFunction], + "addDanger": [MockFunction], + "addError": [MockFunction], + "addInfo": [MockFunction], + "addSuccess": [MockFunction], + "addWarning": [MockFunction], + "get$": [MockFunction], + "remove": [MockFunction], + } + } /> @@ -170,6 +185,7 @@ exports[`TelemetryManagementSectionComponent renders as expected 1`] = ` exports[`TelemetryManagementSectionComponent renders null because allowChangingOptInStatus is false 1`] = ` { const coreStart = coreMock.createStart(); + const docLinks = {} as DocLinksStart['links']; const coreSetup = coreMock.createSetup(); it('renders as expected', () => { @@ -45,6 +47,7 @@ describe('TelemetryManagementSectionComponent', () => { enableSaving={true} isSecurityExampleEnabled={isSecurityExampleEnabled} toasts={coreStart.notifications.toasts} + docLinks={docLinks} /> ) ).toMatchSnapshot(); @@ -78,6 +81,7 @@ describe('TelemetryManagementSectionComponent', () => { enableSaving={true} isSecurityExampleEnabled={isSecurityExampleEnabled} toasts={coreStart.notifications.toasts} + docLinks={docLinks} /> ); @@ -93,6 +97,7 @@ describe('TelemetryManagementSectionComponent', () => { enableSaving={true} toasts={coreStart.notifications.toasts} isSecurityExampleEnabled={isSecurityExampleEnabled} + docLinks={docLinks} /> ); @@ -130,6 +135,7 @@ describe('TelemetryManagementSectionComponent', () => { isSecurityExampleEnabled={isSecurityExampleEnabled} enableSaving={true} toasts={coreStart.notifications.toasts} + docLinks={docLinks} /> ); try { @@ -177,6 +183,7 @@ describe('TelemetryManagementSectionComponent', () => { enableSaving={true} isSecurityExampleEnabled={isSecurityExampleEnabled} toasts={coreStart.notifications.toasts} + docLinks={docLinks} /> ); try { @@ -215,6 +222,7 @@ describe('TelemetryManagementSectionComponent', () => { enableSaving={true} isSecurityExampleEnabled={isSecurityExampleEnabled} toasts={coreStart.notifications.toasts} + docLinks={docLinks} /> ); try { @@ -254,6 +262,7 @@ describe('TelemetryManagementSectionComponent', () => { isSecurityExampleEnabled={isSecurityExampleEnabled} enableSaving={true} toasts={coreStart.notifications.toasts} + docLinks={docLinks} /> ); try { @@ -293,6 +302,7 @@ describe('TelemetryManagementSectionComponent', () => { isSecurityExampleEnabled={isSecurityExampleEnabled} enableSaving={true} toasts={coreStart.notifications.toasts} + docLinks={docLinks} /> ); @@ -332,6 +342,7 @@ describe('TelemetryManagementSectionComponent', () => { enableSaving={true} isSecurityExampleEnabled={isSecurityExampleEnabled} toasts={coreStart.notifications.toasts} + docLinks={docLinks} /> ); try { @@ -382,6 +393,7 @@ describe('TelemetryManagementSectionComponent', () => { enableSaving={true} toasts={coreStart.notifications.toasts} isSecurityExampleEnabled={isSecurityExampleEnabled} + docLinks={docLinks} /> ).html() ).toMatchSnapshot();