From d3a9f2f5b85bea4984592648765e4ed9ba1c7212 Mon Sep 17 00:00:00 2001 From: MarcusNotheis Date: Sun, 3 May 2020 10:23:56 +0200 Subject: [PATCH 1/3] fix(withWebComponent): filter out empty strings Empty strings, e.g. from default props might lead to unintended behavior, e.g. showing a popover header although it was not defined. --- .../__snapshots__/ActionSheet.test.tsx.snap | 7 - .../AnalyticalTable.test.tsx.snap | 253 ------------------ .../__snapshots__/Breadcrumbs.test.tsx.snap | 61 +---- .../__snapshots__/FilterBar.test.tsx.snap | 67 +---- .../Form/__snapshots__/Form.test.tsx.snap | 69 ----- .../__snapshots__/MessageBox.test.tsx.snap | 47 +--- .../__snapshots__/Notification.test.tsx.snap | 54 +--- .../NotificationGroup.test.tsx.snap | 163 +++-------- .../__snapshots__/ObjectPage.test.tsx.snap | 147 +--------- .../__snapshots__/ObjectStatus.test.tsx.snap | 7 - .../SideNavigation.test.tsx.snap | 47 ---- .../SideNavigationListItem.test.tsx.snap | 2 - .../VariantManagement.test.tsx.snap | 15 -- .../main/src/internal/withWebComponent.tsx | 7 +- .../Avatar/__snapshots__/Avatar.test.tsx.snap | 4 - .../__snapshots__/BusyIndicator.test.tsx.snap | 1 - .../Button/__snapshots__/Button.test.tsx.snap | 1 - .../__snapshots__/Calendar.test.tsx.snap | 7 +- .../Card/__snapshots__/Card.test.tsx.snap | 8 +- .../__snapshots__/CheckBox.test.tsx.snap | 2 - .../__snapshots__/ComboBox.test.tsx.snap | 2 - .../__snapshots__/ComboBoxItem.test.tsx.snap | 6 +- .../__snapshots__/DatePicker.test.tsx.snap | 4 - .../DateTimePicker.test.tsx.snap | 4 - .../Dialog/__snapshots__/Dialog.test.tsx.snap | 7 +- .../__snapshots__/FileUploader.test.tsx.snap | 3 - .../Icon/__snapshots__/Icon.test.tsx.snap | 7 +- .../Input/__snapshots__/Input.test.tsx.snap | 2 - .../Label/__snapshots__/Label.test.tsx.snap | 6 +- .../Link/__snapshots__/Link.test.tsx.snap | 2 - .../List/__snapshots__/List.test.tsx.snap | 3 - .../__snapshots__/MultiComboBox.test.tsx.snap | 1 - .../MultiComboBoxItem.test.tsx.snap | 6 +- .../Panel/__snapshots__/Panel.test.tsx.snap | 1 - .../__snapshots__/Popover.test.tsx.snap | 2 - .../ProductSwitchItem.test.tsx.snap | 4 - .../__snapshots__/RadioButton.test.tsx.snap | 2 - .../ResponsivePopover.test.tsx.snap | 2 - .../Select/__snapshots__/Select.test.tsx.snap | 1 - .../__snapshots__/ShellBar.test.tsx.snap | 9 +- .../__snapshots__/ShellBarItem.test.tsx.snap | 8 +- .../SuggestionItem.test.tsx.snap | 1 - .../Switch/__snapshots__/Switch.test.tsx.snap | 7 +- .../Tab/__snapshots__/Tab.test.tsx.snap | 3 - .../Table/__snapshots__/Table.test.tsx.snap | 6 +- .../__snapshots__/TableColumn.test.tsx.snap | 1 - .../__snapshots__/TextArea.test.tsx.snap | 2 - .../__snapshots__/TimePicker.test.tsx.snap | 1 - .../__snapshots__/TimelineItem.test.tsx.snap | 9 +- .../__snapshots__/ToggleButton.test.tsx.snap | 1 - .../UploadCollection.test.tsx.snap | 2 - .../UploadCollectionItem.test.tsx.snap | 1 - 52 files changed, 74 insertions(+), 1011 deletions(-) diff --git a/packages/main/src/components/ActionSheet/__snapshots__/ActionSheet.test.tsx.snap b/packages/main/src/components/ActionSheet/__snapshots__/ActionSheet.test.tsx.snap index fe94ef3b570..370e4501625 100644 --- a/packages/main/src/components/ActionSheet/__snapshots__/ActionSheet.test.tsx.snap +++ b/packages/main/src/components/ActionSheet/__snapshots__/ActionSheet.test.tsx.snap @@ -3,9 +3,7 @@ exports[`ActionSheet Render without Crashing 1`] = ` @@ -19,14 +17,12 @@ exports[`ActionSheet Render without Crashing 1`] = ` Reject This is my super long text! @@ -36,16 +32,13 @@ exports[`ActionSheet Render without Crashing 1`] = ` exports[`ActionSheet does not crash with other component 1`] = ` I should not crash diff --git a/packages/main/src/components/AnalyticalTable/__snapshots__/AnalyticalTable.test.tsx.snap b/packages/main/src/components/AnalyticalTable/__snapshots__/AnalyticalTable.test.tsx.snap index e727731bae9..a9818e3febd 100644 --- a/packages/main/src/components/AnalyticalTable/__snapshots__/AnalyticalTable.test.tsx.snap +++ b/packages/main/src/components/AnalyticalTable/__snapshots__/AnalyticalTable.test.tsx.snap @@ -51,19 +51,14 @@ exports[`AnalyticalTable Alternate Row Color 1`] = ` /> @@ -2339,19 +2246,14 @@ exports[`AnalyticalTable custom row height 1`] = ` /> Link 1 \\ Link 2 \\ Link 3 @@ -42,34 +34,26 @@ exports[`Breadcrumbs separatorStyle: 'DoubleBackSlash' 1`] = `
Link 1 \\\\ Link 2 \\\\ Link 3 @@ -80,34 +64,26 @@ exports[`Breadcrumbs separatorStyle: 'DoubleGreaterThan' 1`] = `
Link 1 >> Link 2 >> Link 3 @@ -118,34 +94,26 @@ exports[`Breadcrumbs separatorStyle: 'DoubleSlash' 1`] = `
Link 1 // Link 2 // Link 3 @@ -156,34 +124,26 @@ exports[`Breadcrumbs separatorStyle: 'GreaterThan' 1`] = `
Link 1 > Link 2 > Link 3 @@ -194,34 +154,26 @@ exports[`Breadcrumbs separatorStyle: 'Slash' 1`] = `
Link 1 / Link 2 / Link 3 @@ -232,46 +184,35 @@ exports[`Breadcrumbs with currentLocationText 1`] = `
Link 1 / Link 2 / Link 3 / - + Current Location
diff --git a/packages/main/src/components/FilterBar/__snapshots__/FilterBar.test.tsx.snap b/packages/main/src/components/FilterBar/__snapshots__/FilterBar.test.tsx.snap index 6570d812243..084e674f2a2 100644 --- a/packages/main/src/components/FilterBar/__snapshots__/FilterBar.test.tsx.snap +++ b/packages/main/src/components/FilterBar/__snapshots__/FilterBar.test.tsx.snap @@ -23,23 +23,18 @@ exports[`FilterBar Hide Filter Bar 1`] = ` Cancel Show Filter Bar @@ -82,13 +76,10 @@ exports[`FilterBar Hide Filter Bar 1`] = `
- + Classification @@ -111,16 +102,12 @@ exports[`FilterBar Hide Filter Bar 1`] = `
- + Custom Filter 1
@@ -131,9 +118,7 @@ exports[`FilterBar Hide Filter Bar 1`] = `
- + Custom Filter 1
@@ -175,23 +159,18 @@ exports[`FilterBar Render without crashing 1`] = ` Cancel Hide Filter Bar @@ -247,13 +224,10 @@ exports[`FilterBar Render without crashing 1`] = `
- + Classification @@ -276,16 +250,12 @@ exports[`FilterBar Render without crashing 1`] = `
- + Custom Filter 1
@@ -317,23 +287,18 @@ exports[`FilterBar Select Filter Item 1`] = ` Cancel Hide Filter Bar @@ -376,13 +340,10 @@ exports[`FilterBar Select Filter Item 1`] = `
- + Classification @@ -405,9 +366,7 @@ exports[`FilterBar Select Filter Item 1`] = `
- + Classification
@@ -428,14 +386,10 @@ exports[`FilterBar Select Filter Item 1`] = `
- + Classification - + Classification diff --git a/packages/main/src/components/Form/__snapshots__/Form.test.tsx.snap b/packages/main/src/components/Form/__snapshots__/Form.test.tsx.snap index 4aea66fdaf7..d4f8e7dcb95 100644 --- a/packages/main/src/components/Form/__snapshots__/Form.test.tsx.snap +++ b/packages/main/src/components/Form/__snapshots__/Form.test.tsx.snap @@ -17,7 +17,6 @@ exports[`Create a Form accepts both label and labelText 1`] = ` > item 1: @@ -27,8 +26,6 @@ exports[`Create a Form accepts both label and labelText 1`] = ` style="width: 66%;" > Label Text: @@ -55,8 +51,6 @@ exports[`Create a Form accepts both label and labelText 1`] = ` style="width: 66%;" > @@ -84,8 +77,6 @@ exports[`Create a Form accepts both label and labelText 1`] = ` style="width: 66%;" > item 1: @@ -132,8 +122,6 @@ Array [ style="width: 66%;" > item 2: @@ -160,8 +147,6 @@ Array [ style="width: 66%;" > item 1: @@ -209,8 +193,6 @@ Array [ style="width: 66%;" > item 2: @@ -237,8 +218,6 @@ Array [ style="width: 66%;" > item 1: @@ -292,8 +270,6 @@ Array [ style="width: 66%;" > item 2: @@ -320,8 +295,6 @@ Array [ style="width: 66%;" > item 1: @@ -360,8 +332,6 @@ Array [ style="width: 66%;" > item 2: @@ -388,8 +357,6 @@ Array [ style="width: 66%;" > item 1: @@ -443,8 +409,6 @@ Array [ style="width: 83%;" > item 2: @@ -471,8 +434,6 @@ Array [ style="width: 83%;" > item 1: @@ -511,8 +471,6 @@ Array [ style="width: 83%;" > item 2: @@ -539,8 +496,6 @@ Array [ style="width: 83%;" > item 1: @@ -594,8 +548,6 @@ Array [ style="width: 100%;" > item 2: @@ -622,8 +573,6 @@ Array [ style="width: 100%;" > item 1: @@ -662,8 +610,6 @@ Array [ style="width: 100%;" > item 2: @@ -690,8 +635,6 @@ Array [ style="width: 100%;" > item 1: @@ -745,8 +687,6 @@ Array [ style="width: 66%;" > item 2: @@ -773,8 +712,6 @@ Array [ style="width: 66%;" > item 1: @@ -813,8 +749,6 @@ Array [ style="width: 66%;" > item 2: @@ -841,8 +774,6 @@ Array [ style="width: 66%;" >
@@ -32,7 +29,6 @@ exports[`MessageBox Confirm - Cancel 1`] = ` OK @@ -40,7 +36,6 @@ exports[`MessageBox Confirm - Cancel 1`] = ` Cancel @@ -56,8 +51,6 @@ exports[`MessageBox Confirm - Cancel 1`] = ` exports[`MessageBox Confirm - OK 1`] = `
@@ -86,7 +78,6 @@ exports[`MessageBox Confirm - OK 1`] = ` OK @@ -94,7 +85,6 @@ exports[`MessageBox Confirm - OK 1`] = ` Cancel @@ -110,8 +100,6 @@ exports[`MessageBox Confirm - OK 1`] = ` exports[`MessageBox Error 1`] = `
@@ -140,7 +127,6 @@ exports[`MessageBox Error 1`] = ` Close @@ -156,8 +142,6 @@ exports[`MessageBox Error 1`] = ` exports[`MessageBox Information 1`] = `
@@ -186,7 +169,6 @@ exports[`MessageBox Information 1`] = ` OK @@ -202,8 +184,6 @@ exports[`MessageBox Information 1`] = ` exports[`MessageBox No Title 1`] = `
@@ -232,7 +211,6 @@ exports[`MessageBox No Title 1`] = ` OK @@ -240,7 +218,6 @@ exports[`MessageBox No Title 1`] = ` Cancel @@ -255,10 +232,7 @@ exports[`MessageBox No Title 1`] = ` `; exports[`MessageBox Not open 1`] = ` - +
@@ -285,7 +258,6 @@ exports[`MessageBox Not open 1`] = ` OK @@ -301,8 +273,6 @@ exports[`MessageBox Not open 1`] = ` exports[`MessageBox Show 1`] = `
@@ -331,7 +300,6 @@ exports[`MessageBox Show 1`] = ` Yes @@ -339,7 +307,6 @@ exports[`MessageBox Show 1`] = ` No @@ -355,8 +322,6 @@ exports[`MessageBox Show 1`] = ` exports[`MessageBox Success 1`] = `
@@ -385,7 +349,6 @@ exports[`MessageBox Success 1`] = ` OK @@ -401,8 +364,6 @@ exports[`MessageBox Success 1`] = ` exports[`MessageBox Success w/ custom title 1`] = `
@@ -431,7 +391,6 @@ exports[`MessageBox Success w/ custom title 1`] = ` OK @@ -447,8 +406,6 @@ exports[`MessageBox Success w/ custom title 1`] = ` exports[`MessageBox Warning 1`] = `
@@ -477,7 +433,6 @@ exports[`MessageBox Warning 1`] = ` OK diff --git a/packages/main/src/components/Notification/__snapshots__/Notification.test.tsx.snap b/packages/main/src/components/Notification/__snapshots__/Notification.test.tsx.snap index 14b6135a0b4..8b6e4877234 100644 --- a/packages/main/src/components/Notification/__snapshots__/Notification.test.tsx.snap +++ b/packages/main/src/components/Notification/__snapshots__/Notification.test.tsx.snap @@ -40,12 +40,8 @@ exports[`Notification Default 1`] = ` @@ -57,7 +53,6 @@ exports[`Notification Default 1`] = ` > Show More @@ -113,12 +108,8 @@ exports[`Notification Long Title and Description 1`] = ` @@ -130,7 +121,6 @@ exports[`Notification Long Title and Description 1`] = ` > Show More @@ -186,12 +176,8 @@ exports[`Notification Long Title and Description w/o truncation 1`] = ` @@ -203,7 +189,6 @@ exports[`Notification Long Title and Description w/o truncation 1`] = ` > Show Less @@ -233,7 +218,6 @@ exports[`Notification w/ Props 1`] = ` class="Notification-semanticIcon-0" > @@ -260,10 +244,7 @@ exports[`Notification w/ Props 1`] = ` class="Notification-avatar-0" >