From 76d8288d24adf75a55efaf45ad0b4f866810fffb Mon Sep 17 00:00:00 2001 From: Mrunal Zambre Date: Thu, 28 Apr 2022 19:32:13 +0530 Subject: [PATCH] updated test cases Signed-off-by: Mrunal Zambre --- .../custom_panel_table.test.tsx.snap | 16 ++-- .../helpers/__tests__/utils.test.tsx | 4 +- .../__snapshots__/no_results.test.tsx.snap | 6 +- .../__snapshots__/config_panel.test.tsx.snap | 84 +++++++++++++++++++ .../__snapshots__/para_input.test.tsx.snap | 4 +- .../__snapshots__/para_output.test.tsx.snap | 2 +- 6 files changed, 101 insertions(+), 15 deletions(-) diff --git a/dashboards-observability/public/components/custom_panels/__tests__/__snapshots__/custom_panel_table.test.tsx.snap b/dashboards-observability/public/components/custom_panels/__tests__/__snapshots__/custom_panel_table.test.tsx.snap index 7ca3027b0..d0ec8dbc5 100644 --- a/dashboards-observability/public/components/custom_panels/__tests__/__snapshots__/custom_panel_table.test.tsx.snap +++ b/dashboards-observability/public/components/custom_panels/__tests__/__snapshots__/custom_panel_table.test.tsx.snap @@ -1894,7 +1894,7 @@ exports[`Panels Table Component renders panel table container 1`] = `
- 11/04/2021 06:10 PM + 11/04/2021 11:40 PM
@@ -1926,7 +1926,7 @@ exports[`Panels Table Component renders panel table container 1`] = `
- 11/02/2021 07:26 PM + 11/03/2021 12:56 AM
@@ -2060,7 +2060,7 @@ exports[`Panels Table Component renders panel table container 1`] = `
- 11/03/2021 10:51 PM + 11/04/2021 04:21 AM
@@ -2092,7 +2092,7 @@ exports[`Panels Table Component renders panel table container 1`] = `
- 11/02/2021 09:44 PM + 11/03/2021 03:14 AM
@@ -2226,7 +2226,7 @@ exports[`Panels Table Component renders panel table container 1`] = `
- 11/03/2021 10:37 PM + 11/04/2021 04:07 AM
@@ -2258,7 +2258,7 @@ exports[`Panels Table Component renders panel table container 1`] = `
- 10/29/2021 10:15 PM + 10/30/2021 03:45 AM
@@ -2392,7 +2392,7 @@ exports[`Panels Table Component renders panel table container 1`] = `
- 11/03/2021 09:26 PM + 11/04/2021 02:56 AM
@@ -2424,7 +2424,7 @@ exports[`Panels Table Component renders panel table container 1`] = `
- 11/03/2021 09:26 PM + 11/04/2021 02:56 AM
diff --git a/dashboards-observability/public/components/custom_panels/helpers/__tests__/utils.test.tsx b/dashboards-observability/public/components/custom_panels/helpers/__tests__/utils.test.tsx index e1d1f1dbb..82395680f 100644 --- a/dashboards-observability/public/components/custom_panels/helpers/__tests__/utils.test.tsx +++ b/dashboards-observability/public/components/custom_panels/helpers/__tests__/utils.test.tsx @@ -38,10 +38,10 @@ describe('Utils helper functions', () => { it('validates convertDateTime function', () => { expect(convertDateTime('2022-01-30T18:44:40.577Z')).toBe( - moment('2022-01-30T18:44:40.577Z').format(PPL_DATE_FORMAT) + moment.utc('2022-01-30T18:44:40.577Z').format(PPL_DATE_FORMAT) ); expect(convertDateTime('2022-02-25T19:18:33.075Z', true)).toBe( - moment('2022-02-25T19:18:33.075Z').format(PPL_DATE_FORMAT) + moment.utc('2022-02-25T19:18:33.075Z').format(PPL_DATE_FORMAT) ); }); diff --git a/dashboards-observability/public/components/event_analytics/__tests__/__snapshots__/no_results.test.tsx.snap b/dashboards-observability/public/components/event_analytics/__tests__/__snapshots__/no_results.test.tsx.snap index a128191e4..33f8d184e 100644 --- a/dashboards-observability/public/components/event_analytics/__tests__/__snapshots__/no_results.test.tsx.snap +++ b/dashboards-observability/public/components/event_analytics/__tests__/__snapshots__/no_results.test.tsx.snap @@ -192,11 +192,13 @@ exports[`No result component Renders No result component 1`] = `

- Your query may not match anything in the current time range, or there may not be any data at all in the currently selected time range. Try change time range, query filters or choose different time fields + Your query may not match anything in the current time range, or there may not be any data at all in + the currently selected time range. Try change time range, query filters or choose different time fields

diff --git a/dashboards-observability/public/components/event_analytics/explorer/visualizations/config_panel/__tests__/__snapshots__/config_panel.test.tsx.snap b/dashboards-observability/public/components/event_analytics/explorer/visualizations/config_panel/__tests__/__snapshots__/config_panel.test.tsx.snap index 69eda470d..db24834dd 100644 --- a/dashboards-observability/public/components/event_analytics/explorer/visualizations/config_panel/__tests__/__snapshots__/config_panel.test.tsx.snap +++ b/dashboards-observability/public/components/event_analytics/explorer/visualizations/config_panel/__tests__/__snapshots__/config_panel.test.tsx.snap @@ -927,6 +927,90 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, }, }, + Object { + "category": "Visualizations", + "categoryAxis": "xaxis", + "component": [Function], + "editorConfig": Object { + "panelTabs": Array [ + Object { + "editor": [Function], + "id": "data-panel", + "mapTo": "dataConfig", + "name": "Data", + "sections": Array [ + Object { + "editor": [Function], + "id": "value_options", + "mapTo": "valueOptions", + "name": "Value options", + "schemas": Array [ + Object { + "component": null, + "isSingleSelection": true, + "mapTo": "childField", + "name": "Child Field", + }, + Object { + "component": null, + "isSingleSelection": true, + "mapTo": "parentField", + "name": "Parent Field", + }, + Object { + "component": null, + "isSingleSelection": true, + "mapTo": "valueField", + "name": "Value Field", + }, + ], + }, + ], + }, + Object { + "content": Array [], + "editor": [Function], + "id": "style-panel", + "mapTo": "layoutConfig", + "name": "Layout", + }, + ], + }, + "fullLabel": "Tree Map", + "icon": [Function], + "iconType": "heatmap", + "id": "tree_map", + "label": "Tree Map", + "name": "tree_map", + "orientation": "v", + "selection": Object { + "dataLoss": "nothing", + }, + "seriesAxis": "yaxis", + "type": "tree_map", + "visConfig": Object { + "config": Object { + "displaylogo": false, + "responsive": true, + }, + "isUniColor": false, + "layout": Object { + "height": 500, + "legend": Object { + "orientation": "v", + "traceorder": "normal", + }, + "margin": Object { + "b": 30, + "l": 60, + "pad": 0, + "r": 30, + "t": 50, + }, + "showlegend": true, + }, + }, + }, ] } placeholder="Select a chart" diff --git a/dashboards-observability/public/components/notebooks/components/paragraph_components/__tests__/__snapshots__/para_input.test.tsx.snap b/dashboards-observability/public/components/notebooks/components/paragraph_components/__tests__/__snapshots__/para_input.test.tsx.snap index 813c41868..0929413ba 100644 --- a/dashboards-observability/public/components/notebooks/components/paragraph_components/__tests__/__snapshots__/para_input.test.tsx.snap +++ b/dashboards-observability/public/components/notebooks/components/paragraph_components/__tests__/__snapshots__/para_input.test.tsx.snap @@ -274,7 +274,7 @@ exports[` spec renders the visualization component 1`] = ` data-test-subj="superDatePickerstartDatePopoverButton" title="2020-07-21T18:37:44.710Z" > - 2020-07-21T18:37:44+00:00 + 2020-07-22T00:07:44+05:30 @@ -298,7 +298,7 @@ exports[` spec renders the visualization component 1`] = ` data-test-subj="superDatePickerendDatePopoverButton" title="2020-08-20T18:37:44.710Z" > - 2020-08-20T18:37:44+00:00 + 2020-08-21T00:07:44+05:30 diff --git a/dashboards-observability/public/components/notebooks/components/paragraph_components/__tests__/__snapshots__/para_output.test.tsx.snap b/dashboards-observability/public/components/notebooks/components/paragraph_components/__tests__/__snapshots__/para_output.test.tsx.snap index 0828c3f4c..7e6ed5737 100644 --- a/dashboards-observability/public/components/notebooks/components/paragraph_components/__tests__/__snapshots__/para_output.test.tsx.snap +++ b/dashboards-observability/public/components/notebooks/components/paragraph_components/__tests__/__snapshots__/para_output.test.tsx.snap @@ -72,6 +72,6 @@ exports[` spec renders visualization outputs 1`] = ` class="euiText euiText--small" style="margin-left: 9px;" > - 2020-07-21T18:37:44+00:00 - 2020-08-20T18:37:44+00:00 + 2020-07-22T00:07:44+05:30 - 2020-08-21T00:07:44+05:30 `;