@dhis2-ui/popper 9.4.4 → 9.4.6
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,17 +1,17 @@
|
|
|
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 Popper with placement bottom-start has a React Ref as its reference', () => {
|
|
6
6
|
cy.visitStory('Popper', 'React Ref As Reference');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('a Popper with placement bottom-start has a DOM node as its reference', () => {
|
|
9
9
|
cy.visitStory('Popper', 'DOM Node As Reference');
|
|
10
10
|
});
|
|
11
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Given)('a Popper with placement bottom-start has a virtual element as its reference', () => {
|
|
12
12
|
cy.visitStory('Popper', 'Virtual Element As Reference');
|
|
13
13
|
});
|
|
14
|
-
(0,
|
|
14
|
+
(0, _cypressCucumberPreprocessor.Then)('the left of the popper is aligned with the left of the reference element', () => {
|
|
15
15
|
cy.all(() => cy.get('button'), () => cy.get('[data-test="dhis2-uicore-popper"]')).should(_ref => {
|
|
16
16
|
let [$reference, $popper] = _ref;
|
|
17
17
|
const referenceRect = $reference.get(0).getBoundingClientRect();
|
|
@@ -19,7 +19,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
19
19
|
expect(referenceRect.left).to.equal(popperRect.left);
|
|
20
20
|
});
|
|
21
21
|
});
|
|
22
|
-
(0,
|
|
22
|
+
(0, _cypressCucumberPreprocessor.Then)('the top of the popper is adjacent to the bottom of the reference element', () => {
|
|
23
23
|
cy.all(() => cy.get('button'), () => cy.get('[data-test="dhis2-uicore-popper"]')).should(_ref2 => {
|
|
24
24
|
let [$reference, $popper] = _ref2;
|
|
25
25
|
const referenceRect = $reference.get(0).getBoundingClientRect();
|
|
@@ -27,7 +27,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
27
27
|
expect(Math.round(referenceRect.bottom)).to.equal(Math.round(popperRect.top));
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
|
-
(0,
|
|
30
|
+
(0, _cypressCucumberPreprocessor.Then)('the top and left of the popper correspond with the virtualElement', () => {
|
|
31
31
|
cy.get('[data-test="dhis2-uicore-popper"]').should($popper => {
|
|
32
32
|
const popperRect = $popper.get(0).getBoundingClientRect();
|
|
33
33
|
expect(popperRect.top).to.equal(200);
|
|
@@ -1,68 +1,68 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
5
|
// Visit stories with different placements
|
|
6
|
-
(0,
|
|
6
|
+
(0, _cypressCucumberPreprocessor.Given)('the Popper is rendered with placement top', () => {
|
|
7
7
|
cy.visitStory('Popper', 'top');
|
|
8
8
|
});
|
|
9
|
-
(0,
|
|
9
|
+
(0, _cypressCucumberPreprocessor.Given)('the Popper is rendered with placement top-start', () => {
|
|
10
10
|
cy.visitStory('Popper', 'top-start');
|
|
11
11
|
});
|
|
12
|
-
(0,
|
|
12
|
+
(0, _cypressCucumberPreprocessor.Given)('the Popper is rendered with placement top-end', () => {
|
|
13
13
|
cy.visitStory('Popper', 'top-end');
|
|
14
14
|
});
|
|
15
|
-
(0,
|
|
15
|
+
(0, _cypressCucumberPreprocessor.Given)('the Popper is rendered with placement right', () => {
|
|
16
16
|
cy.visitStory('Popper', 'right');
|
|
17
17
|
});
|
|
18
|
-
(0,
|
|
18
|
+
(0, _cypressCucumberPreprocessor.Given)('the Popper is rendered with placement right-start', () => {
|
|
19
19
|
cy.visitStory('Popper', 'right-start');
|
|
20
20
|
});
|
|
21
|
-
(0,
|
|
21
|
+
(0, _cypressCucumberPreprocessor.Given)('the Popper is rendered with placement right-end', () => {
|
|
22
22
|
cy.visitStory('Popper', 'right-end');
|
|
23
23
|
});
|
|
24
|
-
(0,
|
|
24
|
+
(0, _cypressCucumberPreprocessor.Given)('the Popper is rendered with placement bottom', () => {
|
|
25
25
|
cy.visitStory('Popper', 'bottom');
|
|
26
26
|
});
|
|
27
|
-
(0,
|
|
27
|
+
(0, _cypressCucumberPreprocessor.Given)('the Popper is rendered with placement bottom-start', () => {
|
|
28
28
|
cy.visitStory('Popper', 'bottom-start');
|
|
29
29
|
});
|
|
30
|
-
(0,
|
|
30
|
+
(0, _cypressCucumberPreprocessor.Given)('the Popper is rendered with placement bottom-end', () => {
|
|
31
31
|
cy.visitStory('Popper', 'bottom-end');
|
|
32
32
|
});
|
|
33
|
-
(0,
|
|
33
|
+
(0, _cypressCucumberPreprocessor.Given)('the Popper is rendered with placement left', () => {
|
|
34
34
|
cy.visitStory('Popper', 'left');
|
|
35
35
|
});
|
|
36
|
-
(0,
|
|
36
|
+
(0, _cypressCucumberPreprocessor.Given)('the Popper is rendered with placement left-start', () => {
|
|
37
37
|
cy.visitStory('Popper', 'left-start');
|
|
38
38
|
});
|
|
39
|
-
(0,
|
|
39
|
+
(0, _cypressCucumberPreprocessor.Given)('the Popper is rendered with placement left-end', () => {
|
|
40
40
|
cy.visitStory('Popper', 'left-end');
|
|
41
41
|
}); // Directional assertions
|
|
42
42
|
// top
|
|
43
43
|
|
|
44
|
-
(0,
|
|
44
|
+
(0, _cypressCucumberPreprocessor.Then)('the bottom of the popper is adjacent to the top of the reference element', () => {
|
|
45
45
|
getRefAndPopperPositions().should(_ref => {
|
|
46
46
|
let [refPos, popperPos] = _ref;
|
|
47
47
|
expect(refPos.top).to.equal(popperPos.bottom);
|
|
48
48
|
});
|
|
49
49
|
}); // right
|
|
50
50
|
|
|
51
|
-
(0,
|
|
51
|
+
(0, _cypressCucumberPreprocessor.Then)('the left of the popper is adjacent to the right of the reference element', () => {
|
|
52
52
|
getRefAndPopperPositions().should(_ref2 => {
|
|
53
53
|
let [refPos, popperPos] = _ref2;
|
|
54
54
|
expect(refPos.right).to.equal(popperPos.left);
|
|
55
55
|
});
|
|
56
56
|
}); // bottom
|
|
57
57
|
|
|
58
|
-
(0,
|
|
58
|
+
(0, _cypressCucumberPreprocessor.Then)('the top of the popper is adjacent to the bottom of the reference element', () => {
|
|
59
59
|
getRefAndPopperPositions().should(_ref3 => {
|
|
60
60
|
let [refPos, popperPos] = _ref3;
|
|
61
61
|
expect(refPos.bottom).to.equal(popperPos.top);
|
|
62
62
|
});
|
|
63
63
|
}); // left
|
|
64
64
|
|
|
65
|
-
(0,
|
|
65
|
+
(0, _cypressCucumberPreprocessor.Then)('the right of the popper is adjacent to the left of the reference element', () => {
|
|
66
66
|
getRefAndPopperPositions().should(_ref4 => {
|
|
67
67
|
let [refPos, popperPos] = _ref4;
|
|
68
68
|
expect(refPos.left).to.equal(popperPos.right);
|
|
@@ -70,14 +70,14 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
70
70
|
}); // Horizontal alignments
|
|
71
71
|
// *-start
|
|
72
72
|
|
|
73
|
-
(0,
|
|
73
|
+
(0, _cypressCucumberPreprocessor.Then)('it is horizontally left aligned with the reference element', () => {
|
|
74
74
|
getRefAndPopperPositions().should(_ref5 => {
|
|
75
75
|
let [refPos, popperPos] = _ref5;
|
|
76
76
|
expect(refPos.left).to.equal(popperPos.left);
|
|
77
77
|
});
|
|
78
78
|
}); // * (no suffix)
|
|
79
79
|
|
|
80
|
-
(0,
|
|
80
|
+
(0, _cypressCucumberPreprocessor.Then)('it is horizontally center aligned with the reference element', () => {
|
|
81
81
|
getRefAndPopperPositions().should(_ref6 => {
|
|
82
82
|
let [refPos, popperPos] = _ref6;
|
|
83
83
|
const refCenterX = refPos.left + refPos.width / 2;
|
|
@@ -86,7 +86,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
86
86
|
});
|
|
87
87
|
}); // *-end
|
|
88
88
|
|
|
89
|
-
(0,
|
|
89
|
+
(0, _cypressCucumberPreprocessor.Then)('it is horizontally right aligned with the reference element', () => {
|
|
90
90
|
getRefAndPopperPositions().should(_ref7 => {
|
|
91
91
|
let [refPos, popperPos] = _ref7;
|
|
92
92
|
expect(refPos.right).to.equal(popperPos.right);
|
|
@@ -94,14 +94,14 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
94
94
|
}); // Vertical alignments
|
|
95
95
|
// *-start
|
|
96
96
|
|
|
97
|
-
(0,
|
|
97
|
+
(0, _cypressCucumberPreprocessor.Then)('it is vertically top aligned with the reference element', () => {
|
|
98
98
|
getRefAndPopperPositions().should(_ref8 => {
|
|
99
99
|
let [refPos, popperPos] = _ref8;
|
|
100
100
|
expect(refPos.top).to.equal(popperPos.top);
|
|
101
101
|
});
|
|
102
102
|
}); // * (no suffix)
|
|
103
103
|
|
|
104
|
-
(0,
|
|
104
|
+
(0, _cypressCucumberPreprocessor.Then)('it is vertically center aligned with the reference element', () => {
|
|
105
105
|
getRefAndPopperPositions().should(_ref9 => {
|
|
106
106
|
let [refPos, popperPos] = _ref9;
|
|
107
107
|
const refCenterY = refPos.top + refPos.height / 2;
|
|
@@ -110,7 +110,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
110
110
|
});
|
|
111
111
|
}); // *-end
|
|
112
112
|
|
|
113
|
-
(0,
|
|
113
|
+
(0, _cypressCucumberPreprocessor.Then)('it is vertically bottom aligned with the reference element', () => {
|
|
114
114
|
getRefAndPopperPositions().should(_ref10 => {
|
|
115
115
|
let [refPos, popperPos] = _ref10;
|
|
116
116
|
expect(refPos.bottom).to.equal(popperPos.bottom);
|
|
@@ -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 Popper with placement bottom-start has a React Ref as its reference', () => {
|
|
3
3
|
cy.visitStory('Popper', 'React Ref As Reference');
|
|
4
4
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor'; // Visit stories with different placements
|
|
2
2
|
|
|
3
3
|
Given('the Popper is rendered with placement top', () => {
|
|
4
4
|
cy.visitStory('Popper', 'top');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/popper",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.6",
|
|
4
4
|
"description": "UI Popper",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@dhis2/prop-types": "^3.1.2",
|
|
36
|
-
"@dhis2/ui-constants": "9.4.
|
|
36
|
+
"@dhis2/ui-constants": "9.4.6",
|
|
37
37
|
"@popperjs/core": "^2.10.1",
|
|
38
38
|
"classnames": "^2.3.1",
|
|
39
39
|
"prop-types": "^15.7.2",
|