-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: make menu click-based and reorganise related components
- Loading branch information
Showing
50 changed files
with
938 additions
and
1,013 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') | ||
}) |
8 changes: 4 additions & 4 deletions
8
...ess/integration/MenuItem/position.feature → ...s/integration/FlyoutMenu/position.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
10 changes: 10 additions & 0 deletions
10
cypress/integration/MenuSectionHeader/accepts_label/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.