@dhis2-ui/intersection-detector 9.4.4 → 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,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('the detector is not intersecting with the root', () => {
|
|
6
6
|
cy.visitStory('IntersectionDetector', 'Out Of View');
|
|
7
7
|
cy.window().then(win => {
|
|
8
8
|
cy.wrap(win.onChange).as('onChangeStub').should('be.calledOnce').should('be.calledWith', {
|
|
@@ -10,7 +10,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
10
10
|
});
|
|
11
11
|
});
|
|
12
12
|
});
|
|
13
|
-
(0,
|
|
13
|
+
(0, _cypressCucumberPreprocessor.Given)('the detector is intersecting with the root', () => {
|
|
14
14
|
cy.visitStory('IntersectionDetector', 'In View');
|
|
15
15
|
cy.window().then(win => {
|
|
16
16
|
cy.wrap(win.onChange).as('onChangeStub').should('be.calledOnce').should('be.calledWith', {
|
|
@@ -18,26 +18,26 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
|
-
(0,
|
|
21
|
+
(0, _cypressCucumberPreprocessor.When)('the user scrolls the detector into view', () => {
|
|
22
22
|
// using 311 to scroll 1px more than "just enough"
|
|
23
23
|
cy.get('[data-test="scroll-container"]').scrollTo(0, 311);
|
|
24
24
|
});
|
|
25
|
-
(0,
|
|
25
|
+
(0, _cypressCucumberPreprocessor.When)('the user scrolls the detector out of view', () => {
|
|
26
26
|
// Scroll 1px more than "just enough" to make sure
|
|
27
27
|
// the detector is completely hidden
|
|
28
28
|
cy.get('[data-test="scroll-container"]').scrollTo(0, 201);
|
|
29
29
|
});
|
|
30
|
-
(0,
|
|
30
|
+
(0, _cypressCucumberPreprocessor.Then)('the callback passed to onChange should be called', () => {
|
|
31
31
|
cy.get('@onChangeStub').should(stub => {
|
|
32
32
|
expect(stub).to.be.calledTwice;
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
|
-
(0,
|
|
35
|
+
(0, _cypressCucumberPreprocessor.Then)('the isIntersecting prop of its payload should be true', () => {
|
|
36
36
|
cy.get('@onChangeStub').should('be.calledWith', {
|
|
37
37
|
isIntersecting: true
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
|
-
(0,
|
|
40
|
+
(0, _cypressCucumberPreprocessor.Then)('the isIntersecting prop of its payload should be false', () => {
|
|
41
41
|
cy.get('@onChangeStub').should('be.calledWith', {
|
|
42
42
|
isIntersecting: false
|
|
43
43
|
});
|
|
@@ -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('the detector is not intersecting with the root', () => {
|
|
3
3
|
cy.visitStory('IntersectionDetector', 'Out Of View');
|
|
4
4
|
cy.window().then(win => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/intersection-detector",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.5",
|
|
4
4
|
"description": "UI IntersectionDetector",
|
|
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.5",
|
|
37
37
|
"classnames": "^2.3.1",
|
|
38
38
|
"prop-types": "^15.7.2"
|
|
39
39
|
},
|