diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/Tab/Tab_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/Tab/Tab_spec.js index 02d02dc33f..05c86b27c6 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/Tab/Tab_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/Tab/Tab_spec.js @@ -167,6 +167,19 @@ describe("Tab widget test", function() { .contains("Aditya") .should("have.class", "is-selected"); }); + it("Validates Total Number Of Tabs Displayed In The Property Pane", () => { + cy.get(Layoutpage.tabNumber).should("have.text", "2 tabs"); + }); + it("Validates Total Number Of Tabs Displayed In The Property Pane After Adding A Tab", () => { + cy.get(Layoutpage.tabButton).click({ force: true }); + cy.get(Layoutpage.tabNumber).should("have.text", "3 tabs"); + }); + it("Validates Total Number Of Tabs Displayed In The Property Pane After Deleting A Tab", () => { + cy.get(Layoutpage.tabDelete) + .eq(1) + .click({ force: true }); + cy.get(Layoutpage.tabNumber).should("have.text", "2 tabs"); + }); }); afterEach(() => { diff --git a/app/client/cypress/locators/Layout.json b/app/client/cypress/locators/Layout.json index 1b79137407..c6c5c65415 100644 --- a/app/client/cypress/locators/Layout.json +++ b/app/client/cypress/locators/Layout.json @@ -7,5 +7,6 @@ "tabDelete": ".t--property-control-tabs .t--delete-column-btn", "tabContainer": "div[type='TABS_WIDGET']", "tabEdit": ".t--property-control-tabs .t--edit-column-btn", - "tabVisibility": ".t--property-control-visible .bp3-control-indicator" + "tabVisibility": ".t--property-control-visible .bp3-control-indicator", + "tabNumber": ".t--number-of-tabs" } diff --git a/app/client/src/components/propertyControls/TabControl.tsx b/app/client/src/components/propertyControls/TabControl.tsx index 72133665e3..51ae730daf 100644 --- a/app/client/src/components/propertyControls/TabControl.tsx +++ b/app/client/src/components/propertyControls/TabControl.tsx @@ -31,6 +31,10 @@ const TabsWrapper = styled.div` flex-direction: column; `; +const NumberOfTabs = styled.div` + margin: 1% 0; +`; + type DroppableItem = BaseItemProps; function AddTabButtonComponent({ widgetId }: any) { @@ -193,14 +197,18 @@ class TabControl extends BaseControl { }); }; render() { + const tabs = this.getTabItems(); return ( + + {tabs.length} tabs +