diff --git a/cypress/integration/ComponentCover/click_behavior.feature b/cypress/integration/ComponentCover/click_behavior.feature
index 90d61e59ac..3302d97213 100644
--- a/cypress/integration/ComponentCover/click_behavior.feature
+++ b/cypress/integration/ComponentCover/click_behavior.feature
@@ -1,10 +1,5 @@
Feature: The ComponentCover has configurable click behaviour
- Scenario: A non-blocking ComponentCover
- Given a ComponentCover with pointerEvents none and a button below it is rendered
- When the user clicks the button
- Then the onClick handler of the button is called
-
Scenario: A blocking ComponentCover
Given a ComponentCover with a button below it is rendered
When the user clicks on the button coordinates
diff --git a/cypress/integration/ComponentCover/click_behavior/index.js b/cypress/integration/ComponentCover/click_behavior/index.js
index d51738a8cd..1a5a3f9eb5 100644
--- a/cypress/integration/ComponentCover/click_behavior/index.js
+++ b/cypress/integration/ComponentCover/click_behavior/index.js
@@ -1,12 +1,5 @@
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'
-Given(
- 'a ComponentCover with pointerEvents none and a button below it is rendered',
- () => {
- cy.visitStory('ComponentCover', 'Non Blocking')
- }
-)
-
Given('a ComponentCover with a button below it is rendered', () => {
cy.visitStory('ComponentCover', 'Blocking')
})
diff --git a/cypress/integration/FlyoutMenu/accepts_children.feature b/cypress/integration/FlyoutMenu/accepts_children.feature
new file mode 100644
index 0000000000..7785383023
--- /dev/null
+++ b/cypress/integration/FlyoutMenu/accepts_children.feature
@@ -0,0 +1,5 @@
+Feature: The FlyoutMenu renders children
+
+ Scenario: A FlyoutMenu with children
+ Given a FlyoutMenu with children is rendered
+ Then the children are visible
diff --git a/cypress/integration/FlyoutMenu/accepts_children/index.js b/cypress/integration/FlyoutMenu/accepts_children/index.js
new file mode 100644
index 0000000000..b3cceced65
--- /dev/null
+++ b/cypress/integration/FlyoutMenu/accepts_children/index.js
@@ -0,0 +1,10 @@
+import { Given, Then } from 'cypress-cucumber-preprocessor/steps'
+
+Given('a FlyoutMenu with children is rendered', () => {
+ cy.visitStory('FlyoutMenu', 'With Children')
+ cy.get('[data-test="dhis2-uicore-menu"]').should('be.visible')
+})
+
+Then('the children are visible', () => {
+ cy.contains('I am a child').should('be.visible')
+})
diff --git a/cypress/integration/MenuItem/position.feature b/cypress/integration/FlyoutMenu/position.feature
similarity index 83%
rename from cypress/integration/MenuItem/position.feature
rename to cypress/integration/FlyoutMenu/position.feature
index 5d54e69812..afa14e33c4 100644
--- a/cypress/integration/MenuItem/position.feature
+++ b/cypress/integration/FlyoutMenu/position.feature
@@ -1,18 +1,18 @@
-Feature: Position of a MenuItem component
+Feature: Position of a SubMenu component
Scenario: Default rendering
Given there is enough space to the right of the MenuItem to fit the SubMenu
- When the user hovers over the MenuItem
+ When the user clicks on the MenuItem
Then the right of the MenuItem is aligned with the left of the SubMenu
And the top of the MenuItem is aligned with the top of the SubMenu wrapper
Scenario: Flipped rendering when insufficient space to the right of
Given there is not enough space to the right of the MenuItem to fit the SubMenu
- When the user hovers over the MenuItem
+ When the user clicks on the MenuItem
Then the left of the MenuItem is aligned with the right of the SubMenu
And the top of the MenuItem is aligned with the top of the SubMenu wrapper
Scenario: Shifting into view when insufficient space to the right of and above
Given there is not enough space to the right or the left of the MenuItem to fit the SubMenu
- When the user hovers over the MenuItem
+ When the user clicks on the MenuItem
Then the SubMenu is rendered on top of the MenuItem
And the top of the MenuItem is aligned with the top of the SubMenu wrapper
diff --git a/cypress/integration/MenuItem/position/index.js b/cypress/integration/FlyoutMenu/position/index.js
similarity index 84%
rename from cypress/integration/MenuItem/position/index.js
rename to cypress/integration/FlyoutMenu/position/index.js
index 3c416629e4..cca8672989 100644
--- a/cypress/integration/MenuItem/position/index.js
+++ b/cypress/integration/FlyoutMenu/position/index.js
@@ -3,26 +3,26 @@ import { Given, Then, When } from 'cypress-cucumber-preprocessor/steps'
Given(
'there is enough space to the right of the MenuItem to fit the SubMenu',
() => {
- cy.visitStory('MenuItem', 'Default position')
+ cy.visitStory('FlyoutMenu', 'Default Position')
}
)
Given(
'there is not enough space to the right of the MenuItem to fit the SubMenu',
() => {
- cy.visitStory('MenuItem', 'Flipped position')
+ cy.visitStory('FlyoutMenu', 'Flipped Position')
}
)
Given(
'there is not enough space to the right or the left of the MenuItem to fit the SubMenu',
() => {
- cy.visitStory('MenuItem', 'Shift into view')
+ cy.visitStory('FlyoutMenu', 'Shift Into View')
}
)
-When('the user hovers over the MenuItem', () => {
- cy.get('[data-test="dhis2-uicore-menuitem"]').trigger('mouseover')
+When('the user clicks on the MenuItem', () => {
+ cy.get('[data-test="dhis2-uicore-menuitem"]').click()
})
Then(
@@ -65,6 +65,6 @@ Then(
function getMenuItemAndSubMenuRects() {
return cy.getPositionsBySelectors(
'[data-test="dhis2-uicore-menuitem"]',
- '[data-test="submenu"]'
+ '[data-test="dhis2-uicore-popper"]'
)
}
diff --git a/cypress/integration/FlyoutMenu/toggles_submenus.feature b/cypress/integration/FlyoutMenu/toggles_submenus.feature
new file mode 100644
index 0000000000..e176d1387f
--- /dev/null
+++ b/cypress/integration/FlyoutMenu/toggles_submenus.feature
@@ -0,0 +1,9 @@
+Feature: The FlyoutMenu toggles SubMenus
+
+ Scenario: a FlyoutMenu with two SubMenus
+ Given a FlyoutMenu with two SubMenus is rendered
+ When the user clicks the first SubMenu anchor
+ Then first SubMenu is visible
+ When the user clicks the second SubMenu anchor
+ Then second SubMenu is visible
+ And the first SubMenu is not visible
diff --git a/cypress/integration/FlyoutMenu/toggles_submenus/index.js b/cypress/integration/FlyoutMenu/toggles_submenus/index.js
new file mode 100644
index 0000000000..93e6dea417
--- /dev/null
+++ b/cypress/integration/FlyoutMenu/toggles_submenus/index.js
@@ -0,0 +1,26 @@
+import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'
+
+Given('a FlyoutMenu with two SubMenus is rendered', () => {
+ cy.visitStory('FlyoutMenu', 'Toggles Sub Menus')
+ cy.get('[data-test="dhis2-uicore-menu"]').should('be.visible')
+})
+
+When('the user clicks the first SubMenu anchor', () => {
+ cy.contains('Item 1').click()
+})
+
+Then('first SubMenu is visible', () => {
+ cy.contains('SubMenu 1').should('be.visible')
+})
+
+When('the user clicks the second SubMenu anchor', () => {
+ cy.contains('Item 2').click()
+})
+
+Then('second SubMenu is visible', () => {
+ cy.contains('SubMenu 2').should('be.visible')
+})
+
+Then('the first SubMenu is not visible', () => {
+ cy.contains('SubMenu 1').should('not.be.visible')
+})
diff --git a/cypress/integration/Layer/click_behavior.feature b/cypress/integration/Layer/click_behavior.feature
index cef3686777..8bbbec12ac 100644
--- a/cypress/integration/Layer/click_behavior.feature
+++ b/cypress/integration/Layer/click_behavior.feature
@@ -1,10 +1,5 @@
Feature: The Layer has configurable click behaviour
- Scenario: A non-blocking layer
- Given a Layer with pointerEvents none and a button below it is rendered
- When the user clicks the button
- Then the onClick handler of the button is called
-
Scenario: A blocking layer
Given a Layer with a button below it is rendered
When the user clicks on the button coordinates
diff --git a/cypress/integration/Layer/click_behavior/index.js b/cypress/integration/Layer/click_behavior/index.js
index 8ed143bbe8..8e7f92afdb 100644
--- a/cypress/integration/Layer/click_behavior/index.js
+++ b/cypress/integration/Layer/click_behavior/index.js
@@ -1,12 +1,5 @@
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'
-Given(
- 'a Layer with pointerEvents none and a button below it is rendered',
- () => {
- cy.visitStory('Layer', 'Non Blocking')
- }
-)
-
Given('a Layer with a button below it is rendered', () => {
cy.visitStory('Layer', 'Blocking')
})
diff --git a/cypress/integration/Menu/accepts_children/index.js b/cypress/integration/Menu/accepts_children/index.js
index afc9b251b4..6b7f951b7a 100644
--- a/cypress/integration/Menu/accepts_children/index.js
+++ b/cypress/integration/Menu/accepts_children/index.js
@@ -2,7 +2,7 @@ import { Given, Then } from 'cypress-cucumber-preprocessor/steps'
Given('a Menu with children is rendered', () => {
cy.visitStory('Menu', 'With children')
- cy.get('[data-test="dhis2-uicore-menu"]').should('be.visible')
+ cy.get('[data-test="dhis2-uicore-menulist"]').should('be.visible')
})
Then('the children are visible', () => {
diff --git a/cypress/integration/MenuItem/accepts_href/index.js b/cypress/integration/MenuItem/accepts_href/index.js
index ccdf236aec..f655b8d3ab 100644
--- a/cypress/integration/MenuItem/accepts_href/index.js
+++ b/cypress/integration/MenuItem/accepts_href/index.js
@@ -1,7 +1,7 @@
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'
Given('a MenuItem with href is rendered', () => {
- cy.visitStory('MenuItem', 'With href')
+ cy.visitStory('MenuItem', 'With Href')
})
Then('a link is rendered with the href', () => {
diff --git a/cypress/integration/MenuItem/accepts_icon/index.js b/cypress/integration/MenuItem/accepts_icon/index.js
index d01985879d..24221621f6 100644
--- a/cypress/integration/MenuItem/accepts_icon/index.js
+++ b/cypress/integration/MenuItem/accepts_icon/index.js
@@ -1,7 +1,7 @@
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'
Given('a MenuItem supplied with an icon is rendered', () => {
- cy.visitStory('MenuItem', 'With icon')
+ cy.visitStory('MenuItem', 'With Icon')
cy.get('[data-test="dhis2-uicore-menuitem"]').should('be.visible')
})
diff --git a/cypress/integration/MenuItem/accepts_label.feature b/cypress/integration/MenuItem/accepts_label.feature
index a902932447..2dd271d7ac 100644
--- a/cypress/integration/MenuItem/accepts_label.feature
+++ b/cypress/integration/MenuItem/accepts_label.feature
@@ -2,4 +2,4 @@ Feature: The MenuItem accepts a label prop
Scenario: MenuItem renders supplied label
Given a MenuItem supplied with a label is rendered
- Then the label will be visible
+ Then the label is visible
\ No newline at end of file
diff --git a/cypress/integration/MenuItem/accepts_label/index.js b/cypress/integration/MenuItem/accepts_label/index.js
index 1285c48e35..ec48d8d87f 100644
--- a/cypress/integration/MenuItem/accepts_label/index.js
+++ b/cypress/integration/MenuItem/accepts_label/index.js
@@ -1,10 +1,10 @@
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'
Given('a MenuItem supplied with a label is rendered', () => {
- cy.visitStory('MenuItem', 'With label')
+ cy.visitStory('MenuItem', 'With Label')
cy.get('[data-test="dhis2-uicore-menuitem"]').should('be.visible')
})
-Then('the label will be visible', () => {
- cy.contains('Label').should('be.visible')
+Then('the label is visible', () => {
+ cy.contains('label').should('be.visible')
})
diff --git a/cypress/integration/MenuItem/accepts_target/index.js b/cypress/integration/MenuItem/accepts_target/index.js
index 69e2f2aa0d..841abfceca 100644
--- a/cypress/integration/MenuItem/accepts_target/index.js
+++ b/cypress/integration/MenuItem/accepts_target/index.js
@@ -1,7 +1,7 @@
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'
Given('a MenuItem with target is rendered', () => {
- cy.visitStory('MenuItem', 'With target')
+ cy.visitStory('MenuItem', 'With Target')
})
Then('a link is rendered with the target', () => {
diff --git a/cypress/integration/MenuItem/is_clickable/index.js b/cypress/integration/MenuItem/is_clickable/index.js
index 0dcd46fe8f..606bb415fd 100644
--- a/cypress/integration/MenuItem/is_clickable/index.js
+++ b/cypress/integration/MenuItem/is_clickable/index.js
@@ -1,7 +1,7 @@
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'
Given('a MenuItem with onClick handler and value is rendered', () => {
- cy.visitStory('MenuItem', 'With onClick and value')
+ cy.visitStory('MenuItem', 'With On Click And Value')
})
When('the MenuItem is clicked', () => {
diff --git a/cypress/integration/MenuList/accepts_children.feature b/cypress/integration/MenuList/accepts_children.feature
deleted file mode 100644
index a07f814dea..0000000000
--- a/cypress/integration/MenuList/accepts_children.feature
+++ /dev/null
@@ -1,5 +0,0 @@
-Feature: The MenuList renders children
-
- Scenario: A MenuList with children
- Given a MenuList with children is rendered
- Then the children are visible
diff --git a/cypress/integration/MenuList/accepts_children/index.js b/cypress/integration/MenuList/accepts_children/index.js
deleted file mode 100644
index d08806e712..0000000000
--- a/cypress/integration/MenuList/accepts_children/index.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import { Given, Then } from 'cypress-cucumber-preprocessor/steps'
-
-Given('a MenuList with children is rendered', () => {
- cy.visitStory('MenuList', 'With children')
- cy.get('[data-test="dhis2-uicore-menulist"]').should('be.visible')
-})
-
-Then('the children are visible', () => {
- cy.contains('I am a child').should('be.visible')
-})
diff --git a/cypress/integration/MenuSectionHeader/accepts_label.feature b/cypress/integration/MenuSectionHeader/accepts_label.feature
new file mode 100644
index 0000000000..8bf9674564
--- /dev/null
+++ b/cypress/integration/MenuSectionHeader/accepts_label.feature
@@ -0,0 +1,5 @@
+Feature: The MenuSectionHeader accepts a label prop
+
+ Scenario: MenuSectionHeader renders supplied label
+ Given a MenuSectionHeader supplied with a label is rendered
+ Then the label is visible
\ No newline at end of file
diff --git a/cypress/integration/MenuSectionHeader/accepts_label/index.js b/cypress/integration/MenuSectionHeader/accepts_label/index.js
new file mode 100644
index 0000000000..70bb3d779a
--- /dev/null
+++ b/cypress/integration/MenuSectionHeader/accepts_label/index.js
@@ -0,0 +1,10 @@
+import { Given, Then } from 'cypress-cucumber-preprocessor/steps'
+
+Given('a MenuSectionHeader supplied with a label is rendered', () => {
+ cy.visitStory('MenuSectionHeader', 'With Label')
+ cy.get('[data-test="dhis2-uicore-menusectionheader"]').should('be.visible')
+})
+
+Then('the label is visible', () => {
+ cy.contains('label').should('be.visible')
+})
diff --git a/packages/core/src/ComponentCover/ComponentCover.js b/packages/core/src/ComponentCover/ComponentCover.js
index efe1c65dcb..9bbe122d1c 100644
--- a/packages/core/src/ComponentCover/ComponentCover.js
+++ b/packages/core/src/ComponentCover/ComponentCover.js
@@ -23,7 +23,6 @@ const ComponentCover = ({
className,
dataTest,
onClick,
- pointerEvents,
translucent,
}) => (