From 27152ad786356240548fcff52fe8dce91a842cd9 Mon Sep 17 00:00:00 2001 From: Dan Dong Date: Fri, 2 Aug 2024 10:19:51 -0700 Subject: [PATCH] Updated Snapshot Testing for get_no_items_message Signed-off-by: Dan Dong --- .../get_no_items_message.test.tsx.snap | 485 ++++++++++++++++++ .../utils/get_no_items_message.test.tsx | 6 + 2 files changed, 491 insertions(+) diff --git a/src/plugins/dashboard/public/application/utils/__snapshots__/get_no_items_message.test.tsx.snap b/src/plugins/dashboard/public/application/utils/__snapshots__/get_no_items_message.test.tsx.snap index 1edc1fb5dd89..3907c106ebf6 100644 --- a/src/plugins/dashboard/public/application/utils/__snapshots__/get_no_items_message.test.tsx.snap +++ b/src/plugins/dashboard/public/application/utils/__snapshots__/get_no_items_message.test.tsx.snap @@ -271,3 +271,488 @@ exports[`dashboard listing table with no item and no write controls 1`] = ` `; + +exports[`dashboard listing table with no item and with write controls 1`] = ` + + + + } + body={ + + +

+ +

+

+ + + , + } + } + /> +

+
+
+ } + iconType="dashboardApp" + intl={ + Object { + "defaultFormats": Object {}, + "defaultLocale": "en", + "formatDate": [Function], + "formatHTMLMessage": [Function], + "formatMessage": [Function], + "formatNumber": [Function], + "formatPlural": [Function], + "formatRelative": [Function], + "formatTime": [Function], + "formats": Object { + "date": Object { + "full": Object { + "day": "numeric", + "month": "long", + "weekday": "long", + "year": "numeric", + }, + "long": Object { + "day": "numeric", + "month": "long", + "year": "numeric", + }, + "medium": Object { + "day": "numeric", + "month": "short", + "year": "numeric", + }, + "short": Object { + "day": "numeric", + "month": "numeric", + "year": "2-digit", + }, + }, + "number": Object { + "currency": Object { + "style": "currency", + }, + "percent": Object { + "style": "percent", + }, + }, + "relative": Object { + "days": Object { + "units": "day", + }, + "hours": Object { + "units": "hour", + }, + "minutes": Object { + "units": "minute", + }, + "months": Object { + "units": "month", + }, + "seconds": Object { + "units": "second", + }, + "years": Object { + "units": "year", + }, + }, + "time": Object { + "full": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + "timeZoneName": "short", + }, + "long": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + "timeZoneName": "short", + }, + "medium": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + }, + "short": Object { + "hour": "numeric", + "minute": "numeric", + }, + }, + }, + "formatters": Object { + "getDateTimeFormat": [Function], + "getMessageFormat": [Function], + "getNumberFormat": [Function], + "getPluralFormat": [Function], + "getRelativeFormat": [Function], + }, + "locale": "en", + "messages": Object {}, + "now": [Function], + "onError": [Function], + "textComponent": Symbol(react.fragment), + "timeZone": null, + } + } + title={ + +

+ +

+
+ } +> +
+ + + + +
+ + + +
+

+ + Create your first dashboard + +

+
+
+
+ + + +
+ + +
+ +
+

+ + You can combine data views from any OpenSearch Dashboards app into one dashboard and see everything in one place. + +

+

+ + + , + } + } + > + New to OpenSearch Dashboards? + + + + to take a test drive. + +

+
+
+
+
+ + + +
+ + + + + + + + +
+ +`; diff --git a/src/plugins/dashboard/public/application/utils/get_no_items_message.test.tsx b/src/plugins/dashboard/public/application/utils/get_no_items_message.test.tsx index 999f6412f6fc..bbddf1848247 100644 --- a/src/plugins/dashboard/public/application/utils/get_no_items_message.test.tsx +++ b/src/plugins/dashboard/public/application/utils/get_no_items_message.test.tsx @@ -13,4 +13,10 @@ describe('dashboard listing table with no item', () => { expect(component).toMatchSnapshot(); }); + + test('and with write controls', () => { + const component = mountWithIntl(getNoItemsMessage(false, jest.fn(), {} as ApplicationStart)); + + expect(component).toMatchSnapshot(); + }); });