@dhis2-ui/popover 9.4.3 → 9.4.5

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.
@@ -1,23 +1,23 @@
1
1
  "use strict";
2
2
 
3
- var _steps = require("cypress-cucumber-preprocessor/steps");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- (0, _steps.Given)('a Popover is rendered with placement top', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a Popover is rendered with placement top', () => {
6
6
  cy.visitStory('Popover', 'Placement Top');
7
7
  });
8
- (0, _steps.Given)('a Popover is rendered with placement right', () => {
8
+ (0, _cypressCucumberPreprocessor.Given)('a Popover is rendered with placement right', () => {
9
9
  cy.visitStory('Popover', 'Placement Right');
10
10
  });
11
- (0, _steps.Given)('a Popover is rendered with placement bottom', () => {
11
+ (0, _cypressCucumberPreprocessor.Given)('a Popover is rendered with placement bottom', () => {
12
12
  cy.visitStory('Popover', 'Placement Bottom');
13
13
  });
14
- (0, _steps.Given)('a Popover is rendered with placement left', () => {
14
+ (0, _cypressCucumberPreprocessor.Given)('a Popover is rendered with placement left', () => {
15
15
  cy.visitStory('Popover', 'Placement Left');
16
16
  });
17
- (0, _steps.Given)('a Popover with position left is shifted into view', () => {
17
+ (0, _cypressCucumberPreprocessor.Given)('a Popover with position left is shifted into view', () => {
18
18
  cy.visitStory('Popover', 'Shifted Arrow');
19
19
  });
20
- (0, _steps.Then)('the Arrow is horizontally aligned with the Popper', () => {
20
+ (0, _cypressCucumberPreprocessor.Then)('the Arrow is horizontally aligned with the Popper', () => {
21
21
  cy.all(() => cy.get('[data-test="dhis2-uicore-popover"]'), () => cy.get('[data-test="dhis2-uicore-popoverarrow"]')).should(_ref => {
22
22
  let [$popover, $arrow] = _ref;
23
23
  const popoverRect = $popover.get(0).getBoundingClientRect();
@@ -27,7 +27,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
27
27
  expect(popoverCenterX).to.equal(arrowCenterX);
28
28
  });
29
29
  });
30
- (0, _steps.Then)('the Arrow is vertically aligned with the Popper', () => {
30
+ (0, _cypressCucumberPreprocessor.Then)('the Arrow is vertically aligned with the Popper', () => {
31
31
  cy.all(() => cy.get('[data-test="dhis2-uicore-popover"]'), () => cy.get('[data-test="dhis2-uicore-popoverarrow"]')).should(_ref2 => {
32
32
  let [$popover, $arrow] = _ref2;
33
33
  const popoverRect = $popover.get(0).getBoundingClientRect();
@@ -37,7 +37,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
37
37
  expect(popoverCenterY).to.equal(arrowCenterY);
38
38
  });
39
39
  });
40
- (0, _steps.Then)('the Arrow is vertically aligned with the reference element', () => {
40
+ (0, _cypressCucumberPreprocessor.Then)('the Arrow is vertically aligned with the reference element', () => {
41
41
  cy.all(() => cy.get('[data-test="reference-element"]'), () => cy.get('[data-test="dhis2-uicore-popoverarrow"]')).should(_ref3 => {
42
42
  let [$reference, $arrow] = _ref3;
43
43
  const referenceRect = $reference.get(0).getBoundingClientRect();
@@ -47,7 +47,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
47
47
  expect(referenceCenterY).to.equal(arrowCenterY);
48
48
  });
49
49
  });
50
- (0, _steps.Then)('the Arrow is at the bottom of the Popper', () => {
50
+ (0, _cypressCucumberPreprocessor.Then)('the Arrow is at the bottom of the Popper', () => {
51
51
  cy.all(() => cy.get('[data-test="dhis2-uicore-popover"]'), () => cy.get('[data-test="dhis2-uicore-popoverarrow"]')).should(_ref4 => {
52
52
  let [$popover, $arrow] = _ref4;
53
53
  const popoverRect = $popover.get(0).getBoundingClientRect();
@@ -56,7 +56,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
56
56
  expect(popoverRect.bottom).to.equal(arrowCenterY);
57
57
  });
58
58
  });
59
- (0, _steps.Then)('the Arrow is at the left of the Popper', () => {
59
+ (0, _cypressCucumberPreprocessor.Then)('the Arrow is at the left of the Popper', () => {
60
60
  cy.all(() => cy.get('[data-test="dhis2-uicore-popover"]'), () => cy.get('[data-test="dhis2-uicore-popoverarrow"]')).should(_ref5 => {
61
61
  let [$popover, $arrow] = _ref5;
62
62
  const popoverRect = $popover.get(0).getBoundingClientRect();
@@ -65,7 +65,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
65
65
  expect(popoverRect.left).to.equal(arrowCenterX);
66
66
  });
67
67
  });
68
- (0, _steps.Then)('the Arrow is at the top of the Popper', () => {
68
+ (0, _cypressCucumberPreprocessor.Then)('the Arrow is at the top of the Popper', () => {
69
69
  cy.all(() => cy.get('[data-test="dhis2-uicore-popover"]'), () => cy.get('[data-test="dhis2-uicore-popoverarrow"]')).should(_ref6 => {
70
70
  let [$popover, $arrow] = _ref6;
71
71
  const popoverRect = $popover.get(0).getBoundingClientRect();
@@ -74,7 +74,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
74
74
  expect(popoverRect.top).to.equal(arrowCenterY);
75
75
  });
76
76
  });
77
- (0, _steps.Then)('the Arrow is at the right of the Popper', () => {
77
+ (0, _cypressCucumberPreprocessor.Then)('the Arrow is at the right of the Popper', () => {
78
78
  cy.all(() => cy.get('[data-test="dhis2-uicore-popover"]'), () => cy.get('[data-test="dhis2-uicore-popoverarrow"]')).should(_ref7 => {
79
79
  let [$popover, $arrow] = _ref7;
80
80
  const popoverRect = $popover.get(0).getBoundingClientRect();
@@ -83,7 +83,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
83
83
  expect(popoverRect.right).to.equal(arrowCenterX);
84
84
  });
85
85
  });
86
- (0, _steps.Then)('the Arrow is at the top half of the Popper', () => {
86
+ (0, _cypressCucumberPreprocessor.Then)('the Arrow is at the top half of the Popper', () => {
87
87
  cy.all(() => cy.get('[data-test="dhis2-uicore-popover"]'), () => cy.get('[data-test="dhis2-uicore-popoverarrow"]')).should(_ref8 => {
88
88
  let [$popover, $arrow] = _ref8;
89
89
  const popoverRect = $popover.get(0).getBoundingClientRect();
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
 
3
- var _steps = require("cypress-cucumber-preprocessor/steps");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- (0, _steps.Given)('a default Popper is rendered with arrow set to true', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a default Popper is rendered with arrow set to true', () => {
6
6
  cy.visitStory('Popover', 'Default');
7
7
  });
8
- (0, _steps.Given)('a default Popover is rendered with an onClickOutside handler', () => {
8
+ (0, _cypressCucumberPreprocessor.Given)('a default Popover is rendered with an onClickOutside handler', () => {
9
9
  cy.visitStory('Popover', 'With On Click Outside');
10
10
  });
11
- (0, _steps.When)('the user clicks outside of the Popover', () => {
11
+ (0, _cypressCucumberPreprocessor.When)('the user clicks outside of the Popover', () => {
12
12
  cy.get('[data-test="dhis2-uicore-layer"]').click();
13
13
  });
14
- (0, _steps.Then)('the clickOutside handler is called', () => {
14
+ (0, _cypressCucumberPreprocessor.Then)('the clickOutside handler is called', () => {
15
15
  cy.window().should(win => {
16
16
  expect(win.onClickOutside).to.be.calledOnce;
17
17
  });
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
 
3
- var _steps = require("cypress-cucumber-preprocessor/steps");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- (0, _steps.Given)('a default Popper is rendered with arrow set to true', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a default Popper is rendered with arrow set to true', () => {
6
6
  cy.visitStory('Popover', 'Default');
7
7
  });
8
- (0, _steps.Given)('a Popover is rendered with the arrow prop set to false', () => {
8
+ (0, _cypressCucumberPreprocessor.Given)('a Popover is rendered with the arrow prop set to false', () => {
9
9
  cy.visitStory('Popover', 'No Arrow');
10
10
  });
11
- (0, _steps.Then)('there is an arrow element in the Popover', () => {
11
+ (0, _cypressCucumberPreprocessor.Then)('there is an arrow element in the Popover', () => {
12
12
  cy.get('[data-test="dhis2-uicore-popoverarrow"]').should('exist');
13
13
  });
14
- (0, _steps.Then)('there is no arrow element in the Popover', () => {
14
+ (0, _cypressCucumberPreprocessor.Then)('there is no arrow element in the Popover', () => {
15
15
  cy.get('[data-test="dhis2-uicore-popoverarrow"]').should('not.exist');
16
16
  });
@@ -1,64 +1,64 @@
1
1
  "use strict";
2
2
 
3
- var _steps = require("cypress-cucumber-preprocessor/steps");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
5
  const CLOSE_TO_DELTA = 1; // Stories
6
6
 
7
- (0, _steps.Given)('there is sufficient space to place the Popover above the reference element', () => {
7
+ (0, _cypressCucumberPreprocessor.Given)('there is sufficient space to place the Popover above the reference element', () => {
8
8
  cy.visitStory('Popover', 'Default');
9
9
  });
10
- (0, _steps.Given)('there is not enough space between the reference element top and the body top to fit the Popover', () => {
10
+ (0, _cypressCucumberPreprocessor.Given)('there is not enough space between the reference element top and the body top to fit the Popover', () => {
11
11
  cy.visitStory('Popover', 'Flipped');
12
12
  });
13
- (0, _steps.Given)('there is very little space between the top of the reference element and the top of the body', () => {
13
+ (0, _cypressCucumberPreprocessor.Given)('there is very little space between the top of the reference element and the top of the body', () => {
14
14
  cy.visitStory('Popover', 'Hidden Arrow');
15
15
  }); // Window height manipulation to control the space below the reference element
16
16
 
17
- (0, _steps.Given)('there is sufficient space between the reference element bottom and the body bottom to fit the Popover', () => {
17
+ (0, _cypressCucumberPreprocessor.Given)('there is sufficient space between the reference element bottom and the body bottom to fit the Popover', () => {
18
18
  cy.viewport(1000, 660);
19
19
  });
20
- (0, _steps.Given)('there is not enough space between the reference element bottom and the body bottom to fit the Popover', () => {
20
+ (0, _cypressCucumberPreprocessor.Given)('there is not enough space between the reference element bottom and the body bottom to fit the Popover', () => {
21
21
  cy.viewport(1000, 325);
22
22
  });
23
- (0, _steps.Given)('there is not enough space between the top of the reference element and the top of the Popover to show the arrow', () => {
23
+ (0, _cypressCucumberPreprocessor.Given)('there is not enough space between the top of the reference element and the top of the Popover to show the arrow', () => {
24
24
  cy.viewport(1000, 380);
25
25
  }); // Assertions
26
26
 
27
- (0, _steps.Given)('there is sufficient space between the bottom of the reference element and the bottom of the Popover to show the arrow', () => {
27
+ (0, _cypressCucumberPreprocessor.Given)('there is sufficient space between the bottom of the reference element and the bottom of the Popover to show the arrow', () => {
28
28
  compareRefAndPopoverPositions((refPos, popoverPos) => {
29
29
  expect(refPos.bottom).to.be.greaterThan(popoverPos.bottom + 8);
30
30
  });
31
31
  });
32
- (0, _steps.Then)('the arrow is hiding', () => {
32
+ (0, _cypressCucumberPreprocessor.Then)('the arrow is hiding', () => {
33
33
  cy.get('[data-test="dhis2-uicore-popoverarrow"]').should('not.be.visible');
34
34
  });
35
- (0, _steps.Then)('the arrow is showing', () => {
35
+ (0, _cypressCucumberPreprocessor.Then)('the arrow is showing', () => {
36
36
  cy.get('[data-test="dhis2-uicore-popoverarrow"]').should('be.visible');
37
37
  });
38
- (0, _steps.Then)('the horizontal center of the popover is aligned with the horizontal center of the reference element', () => {
38
+ (0, _cypressCucumberPreprocessor.Then)('the horizontal center of the popover is aligned with the horizontal center of the reference element', () => {
39
39
  compareRefAndPopoverPositions((refPos, popoverPos) => {
40
40
  const refCenter = refPos.left + refPos.width / 2;
41
41
  const popoverCenter = popoverPos.left + popoverPos.width / 2;
42
42
  expect(refCenter).to.be.closeTo(popoverCenter, CLOSE_TO_DELTA);
43
43
  });
44
44
  });
45
- (0, _steps.Then)('the popover is placed above the reference element', () => {
45
+ (0, _cypressCucumberPreprocessor.Then)('the popover is placed above the reference element', () => {
46
46
  compareRefAndPopoverPositions((refPos, popoverPos) => {
47
47
  expect(refPos.top).to.be.greaterThan(popoverPos.bottom);
48
48
  });
49
49
  });
50
- (0, _steps.Then)('the popover is placed below the reference element', () => {
50
+ (0, _cypressCucumberPreprocessor.Then)('the popover is placed below the reference element', () => {
51
51
  compareRefAndPopoverPositions((refPos, popoverPos) => {
52
52
  expect(popoverPos.top).to.be.greaterThan(refPos.bottom);
53
53
  });
54
54
  });
55
- (0, _steps.Then)('the popover is placed op top of the reference element', () => {
55
+ (0, _cypressCucumberPreprocessor.Then)('the popover is placed op top of the reference element', () => {
56
56
  compareRefAndPopoverPositions((refPos, popoverPos) => {
57
57
  expect(popoverPos.bottom).to.be.greaterThan(refPos.top);
58
58
  expect(refPos.top).to.be.greaterThan(popoverPos.top);
59
59
  });
60
60
  });
61
- (0, _steps.Then)('there is some space between the anchor and the popover', () => {
61
+ (0, _cypressCucumberPreprocessor.Then)('there is some space between the anchor and the popover', () => {
62
62
  compareRefAndPopoverPositions((refPos, popoverPos) => {
63
63
  expect(popoverPos.bottom + 8).to.be.closeTo(refPos.top, CLOSE_TO_DELTA);
64
64
  });
@@ -1,4 +1,4 @@
1
- import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
2
2
  Given('a Popover is rendered with placement top', () => {
3
3
  cy.visitStory('Popover', 'Placement Top');
4
4
  });
@@ -1,4 +1,4 @@
1
- import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
2
2
  Given('a default Popper is rendered with arrow set to true', () => {
3
3
  cy.visitStory('Popover', 'Default');
4
4
  });
@@ -1,4 +1,4 @@
1
- import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
2
2
  Given('a default Popper is rendered with arrow set to true', () => {
3
3
  cy.visitStory('Popover', 'Default');
4
4
  });
@@ -1,4 +1,4 @@
1
- import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
1
+ import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
2
2
  const CLOSE_TO_DELTA = 1; // Stories
3
3
 
4
4
  Given('there is sufficient space to place the Popover above the reference element', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/popover",
3
- "version": "9.4.3",
3
+ "version": "9.4.5",
4
4
  "description": "UI Popover",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,9 +33,9 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@dhis2/prop-types": "^3.1.2",
36
- "@dhis2-ui/layer": "9.4.3",
37
- "@dhis2-ui/popper": "9.4.3",
38
- "@dhis2/ui-constants": "9.4.3",
36
+ "@dhis2-ui/layer": "9.4.5",
37
+ "@dhis2-ui/popper": "9.4.5",
38
+ "@dhis2/ui-constants": "9.4.5",
39
39
  "classnames": "^2.3.1",
40
40
  "prop-types": "^15.7.2"
41
41
  },