@dhis2-ui/menu 9.5.0-alpha.1 → 9.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/flyout-menu/features/accepts_children/index.js +3 -3
- package/build/cjs/flyout-menu/features/position/index.js +9 -9
- package/build/cjs/flyout-menu/features/toggles_submenus/index.js +7 -7
- package/build/cjs/menu/features/accepts_children/index.js +3 -3
- package/build/cjs/menu-item/features/accepts_href/index.js +3 -3
- package/build/cjs/menu-item/features/accepts_icon/index.js +3 -3
- package/build/cjs/menu-item/features/accepts_label/index.js +3 -3
- package/build/cjs/menu-item/features/accepts_suffix/index.js +3 -3
- package/build/cjs/menu-item/features/accepts_target/index.js +3 -3
- package/build/cjs/menu-item/features/is_clickable/index.js +4 -4
- package/build/cjs/menu-section-header/features/accepts_label/index.js +3 -3
- package/build/es/flyout-menu/features/accepts_children/index.js +1 -1
- package/build/es/flyout-menu/features/position/index.js +1 -1
- package/build/es/flyout-menu/features/toggles_submenus/index.js +1 -1
- package/build/es/menu/features/accepts_children/index.js +1 -1
- package/build/es/menu-item/features/accepts_href/index.js +1 -1
- package/build/es/menu-item/features/accepts_icon/index.js +1 -1
- package/build/es/menu-item/features/accepts_label/index.js +1 -1
- package/build/es/menu-item/features/accepts_suffix/index.js +1 -1
- package/build/es/menu-item/features/accepts_target/index.js +1 -1
- package/build/es/menu-item/features/is_clickable/index.js +1 -1
- package/build/es/menu-section-header/features/accepts_label/index.js +1 -1
- package/package.json +8 -8
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a FlyoutMenu with children is rendered', () => {
|
|
6
6
|
cy.visitStory('FlyoutMenu', 'With Children');
|
|
7
7
|
cy.get('[data-test="dhis2-uicore-menu"]').should('be.visible');
|
|
8
8
|
});
|
|
9
|
-
(0,
|
|
9
|
+
(0, _cypressCucumberPreprocessor.Then)('the children are visible', () => {
|
|
10
10
|
cy.contains('I am a child').should('be.visible');
|
|
11
11
|
});
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
5
|
const CLOSE_TO_DELTA = 1;
|
|
6
|
-
(0,
|
|
6
|
+
(0, _cypressCucumberPreprocessor.Given)('there is enough space to the right of the MenuItem to fit the SubMenu', () => {
|
|
7
7
|
cy.visitStory('FlyoutMenu', 'Default Position');
|
|
8
8
|
});
|
|
9
|
-
(0,
|
|
9
|
+
(0, _cypressCucumberPreprocessor.Given)('there is not enough space to the right of the MenuItem to fit the SubMenu', () => {
|
|
10
10
|
cy.visitStory('FlyoutMenu', 'Flipped Position');
|
|
11
11
|
});
|
|
12
|
-
(0,
|
|
12
|
+
(0, _cypressCucumberPreprocessor.Given)('there is not enough space to the right or the left of the MenuItem to fit the SubMenu', () => {
|
|
13
13
|
cy.visitStory('FlyoutMenu', 'Shift Into View');
|
|
14
14
|
});
|
|
15
|
-
(0,
|
|
15
|
+
(0, _cypressCucumberPreprocessor.When)('the user clicks on the MenuItem', () => {
|
|
16
16
|
cy.get('[data-test="dhis2-uicore-menuitem"]').click();
|
|
17
17
|
});
|
|
18
|
-
(0,
|
|
18
|
+
(0, _cypressCucumberPreprocessor.Then)('the right of the MenuItem is aligned with the left of the SubMenu', () => {
|
|
19
19
|
getMenuItemAndSubMenuRects().should(_ref => {
|
|
20
20
|
let [menuItemRect, subMenuRect] = _ref;
|
|
21
21
|
expect(menuItemRect.right).to.closeTo(subMenuRect.left, CLOSE_TO_DELTA);
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
|
-
(0,
|
|
24
|
+
(0, _cypressCucumberPreprocessor.Then)('the left of the MenuItem is aligned with the right of the SubMenu', () => {
|
|
25
25
|
getMenuItemAndSubMenuRects().should(_ref2 => {
|
|
26
26
|
let [menuItemRect, subMenuRect] = _ref2;
|
|
27
27
|
expect(menuItemRect.left).to.closeTo(subMenuRect.right, CLOSE_TO_DELTA);
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
|
-
(0,
|
|
30
|
+
(0, _cypressCucumberPreprocessor.Then)('the SubMenu is rendered on top of the MenuItem', () => {
|
|
31
31
|
getMenuItemAndSubMenuRects().should(_ref3 => {
|
|
32
32
|
let [menuItemRect, subMenuRect] = _ref3;
|
|
33
33
|
expect(subMenuRect.left).to.be.at.most(menuItemRect.left);
|
|
34
34
|
expect(subMenuRect.right).to.be.at.least(menuItemRect.right);
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
|
-
(0,
|
|
37
|
+
(0, _cypressCucumberPreprocessor.Then)('the top of the MenuItem is aligned with the top of the SubMenu wrapper', () => {
|
|
38
38
|
cy.getPositionsBySelectors('[data-test="dhis2-uicore-menuitem"]', '[data-test="dhis2-uicore-popper"]').should(_ref4 => {
|
|
39
39
|
let [menuItemRect, popperRect] = _ref4;
|
|
40
40
|
expect(menuItemRect.top).to.closeTo(popperRect.top, CLOSE_TO_DELTA);
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a FlyoutMenu with two SubMenus is rendered', () => {
|
|
6
6
|
cy.visitStory('FlyoutMenu', 'Toggles Sub Menus');
|
|
7
7
|
cy.get('[data-test="dhis2-uicore-menu"]').should('be.visible');
|
|
8
8
|
});
|
|
9
|
-
(0,
|
|
9
|
+
(0, _cypressCucumberPreprocessor.When)('the user clicks the first SubMenu anchor', () => {
|
|
10
10
|
cy.contains('Item 1').click();
|
|
11
11
|
});
|
|
12
|
-
(0,
|
|
12
|
+
(0, _cypressCucumberPreprocessor.Then)('first SubMenu is visible', () => {
|
|
13
13
|
cy.contains('SubMenu 1').should('be.visible');
|
|
14
14
|
});
|
|
15
|
-
(0,
|
|
15
|
+
(0, _cypressCucumberPreprocessor.When)('the user clicks the second SubMenu anchor', () => {
|
|
16
16
|
cy.contains('Item 2').click();
|
|
17
17
|
});
|
|
18
|
-
(0,
|
|
18
|
+
(0, _cypressCucumberPreprocessor.Then)('second SubMenu is visible', () => {
|
|
19
19
|
cy.contains('SubMenu 2').should('be.visible');
|
|
20
20
|
});
|
|
21
|
-
(0,
|
|
21
|
+
(0, _cypressCucumberPreprocessor.Then)('the first SubMenu is not rendered', () => {
|
|
22
22
|
cy.contains('SubMenu 1').should('not.exist');
|
|
23
23
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a Menu with children is rendered', () => {
|
|
6
6
|
cy.visitStory('Menu', 'With children');
|
|
7
7
|
cy.get('[data-test="dhis2-uicore-menulist"]').should('be.visible');
|
|
8
8
|
});
|
|
9
|
-
(0,
|
|
9
|
+
(0, _cypressCucumberPreprocessor.Then)('the children are visible', () => {
|
|
10
10
|
cy.contains('I am a child').should('be.visible');
|
|
11
11
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MenuItem with href is rendered', () => {
|
|
6
6
|
cy.visitStory('MenuItem', 'With Href');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Then)('a link is rendered with the href', () => {
|
|
9
9
|
cy.get('a').should('have.attr', 'href').and('include', 'url.test');
|
|
10
10
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MenuItem supplied with an icon is rendered', () => {
|
|
6
6
|
cy.visitStory('MenuItem', 'With Icon');
|
|
7
7
|
cy.get('[data-test="dhis2-uicore-menuitem"]').should('be.visible');
|
|
8
8
|
});
|
|
9
|
-
(0,
|
|
9
|
+
(0, _cypressCucumberPreprocessor.Then)('the icon will be visible', () => {
|
|
10
10
|
cy.contains('Icon').should('be.visible');
|
|
11
11
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MenuItem supplied with a label is rendered', () => {
|
|
6
6
|
cy.visitStory('MenuItem', 'With Label');
|
|
7
7
|
cy.get('[data-test="dhis2-uicore-menuitem"]').should('be.visible');
|
|
8
8
|
});
|
|
9
|
-
(0,
|
|
9
|
+
(0, _cypressCucumberPreprocessor.Then)('the label is visible', () => {
|
|
10
10
|
cy.contains('label').should('be.visible');
|
|
11
11
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MenuItem supplied with a suffix is rendered', () => {
|
|
6
6
|
cy.visitStory('MenuItem', 'With Suffix');
|
|
7
7
|
cy.get('[data-test="dhis2-uicore-menuitem"]').should('be.visible');
|
|
8
8
|
});
|
|
9
|
-
(0,
|
|
9
|
+
(0, _cypressCucumberPreprocessor.Then)('the suffix will be visible', () => {
|
|
10
10
|
cy.contains('Suffix').should('be.visible');
|
|
11
11
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MenuItem with target is rendered', () => {
|
|
6
6
|
cy.visitStory('MenuItem', 'With Target');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Then)('a link is rendered with the target', () => {
|
|
9
9
|
cy.get('a').should('have.attr', 'target').and('include', '_blank');
|
|
10
10
|
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MenuItem with onClick handler and value is rendered', () => {
|
|
6
6
|
cy.visitStory('MenuItem', 'With On Click And Value');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.When)('the MenuItem is clicked', () => {
|
|
9
9
|
cy.get('[data-test="dhis2-uicore-menuitem"]').click();
|
|
10
10
|
});
|
|
11
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Then)('the onClick handler is called with value', () => {
|
|
12
12
|
cy.window().should(win => {
|
|
13
13
|
expect(win.onClick).to.be.calledWith({
|
|
14
14
|
value: 'Value'
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MenuSectionHeader supplied with a label is rendered', () => {
|
|
6
6
|
cy.visitStory('MenuSectionHeader', 'With Label');
|
|
7
7
|
cy.get('[data-test="dhis2-uicore-menusectionheader"]').should('be.visible');
|
|
8
8
|
});
|
|
9
|
-
(0,
|
|
9
|
+
(0, _cypressCucumberPreprocessor.Then)('the label is visible', () => {
|
|
10
10
|
cy.contains('label').should('be.visible');
|
|
11
11
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('a FlyoutMenu with children is rendered', () => {
|
|
3
3
|
cy.visitStory('FlyoutMenu', 'With Children');
|
|
4
4
|
cy.get('[data-test="dhis2-uicore-menu"]').should('be.visible');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, Then, When } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, Then, When } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
const CLOSE_TO_DELTA = 1;
|
|
3
3
|
Given('there is enough space to the right of the MenuItem to fit the SubMenu', () => {
|
|
4
4
|
cy.visitStory('FlyoutMenu', 'Default Position');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('a FlyoutMenu with two SubMenus is rendered', () => {
|
|
3
3
|
cy.visitStory('FlyoutMenu', 'Toggles Sub Menus');
|
|
4
4
|
cy.get('[data-test="dhis2-uicore-menu"]').should('be.visible');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('a Menu with children is rendered', () => {
|
|
3
3
|
cy.visitStory('Menu', 'With children');
|
|
4
4
|
cy.get('[data-test="dhis2-uicore-menulist"]').should('be.visible');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('a MenuItem supplied with an icon is rendered', () => {
|
|
3
3
|
cy.visitStory('MenuItem', 'With Icon');
|
|
4
4
|
cy.get('[data-test="dhis2-uicore-menuitem"]').should('be.visible');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('a MenuItem supplied with a label is rendered', () => {
|
|
3
3
|
cy.visitStory('MenuItem', 'With Label');
|
|
4
4
|
cy.get('[data-test="dhis2-uicore-menuitem"]').should('be.visible');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('a MenuItem supplied with a suffix is rendered', () => {
|
|
3
3
|
cy.visitStory('MenuItem', 'With Suffix');
|
|
4
4
|
cy.get('[data-test="dhis2-uicore-menuitem"]').should('be.visible');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('a MenuItem with onClick handler and value is rendered', () => {
|
|
3
3
|
cy.visitStory('MenuItem', 'With On Click And Value');
|
|
4
4
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('a MenuSectionHeader supplied with a label is rendered', () => {
|
|
3
3
|
cy.visitStory('MenuSectionHeader', 'With Label');
|
|
4
4
|
cy.get('[data-test="dhis2-uicore-menusectionheader"]').should('be.visible');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/menu",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.6.0",
|
|
4
4
|
"description": "UI Menu",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@dhis2/prop-types": "^3.1.2",
|
|
36
|
-
"@dhis2-ui/card": "9.
|
|
37
|
-
"@dhis2-ui/divider": "9.
|
|
38
|
-
"@dhis2-ui/layer": "9.
|
|
39
|
-
"@dhis2-ui/popper": "9.
|
|
40
|
-
"@dhis2-ui/portal": "9.
|
|
41
|
-
"@dhis2/ui-constants": "9.
|
|
42
|
-
"@dhis2/ui-icons": "9.
|
|
36
|
+
"@dhis2-ui/card": "9.6.0",
|
|
37
|
+
"@dhis2-ui/divider": "9.6.0",
|
|
38
|
+
"@dhis2-ui/layer": "9.6.0",
|
|
39
|
+
"@dhis2-ui/popper": "9.6.0",
|
|
40
|
+
"@dhis2-ui/portal": "9.6.0",
|
|
41
|
+
"@dhis2/ui-constants": "9.6.0",
|
|
42
|
+
"@dhis2/ui-icons": "9.6.0",
|
|
43
43
|
"classnames": "^2.3.1",
|
|
44
44
|
"prop-types": "^15.7.2"
|
|
45
45
|
},
|