@dhis2-ui/select 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.
- package/build/cjs/multi-select/features/accepts_blur_cb/index.js +3 -5
- package/build/cjs/multi-select/features/accepts_focus_cb/index.js +3 -5
- package/build/cjs/multi-select/features/accepts_initial_focus/index.js +2 -4
- package/build/cjs/multi-select/features/accepts_loading/index.js +5 -7
- package/build/cjs/multi-select/features/accepts_max_height/index.js +5 -10
- package/build/cjs/multi-select/features/accepts_placeholder/index.js +6 -8
- package/build/cjs/multi-select/features/accepts_prefix/index.js +5 -7
- package/build/cjs/multi-select/features/allows_invalid_options/index.js +6 -8
- package/build/cjs/multi-select/features/allows_selecting/index.js +16 -18
- package/build/cjs/multi-select/features/can_be_cleared/index.js +4 -6
- package/build/cjs/multi-select/features/can_be_disabled/index.js +9 -14
- package/build/cjs/multi-select/features/can_be_empty/index.js +7 -9
- package/build/cjs/multi-select/features/can_be_filtered/index.js +6 -8
- package/build/cjs/multi-select/features/can_be_opened_and_closed/index.js +8 -10
- package/build/cjs/multi-select/features/common/index.js +10 -10
- package/build/cjs/multi-select/features/duplicate_option_values/index.js +4 -6
- package/build/cjs/multi-select/features/menu_width_matches_input/index.js +8 -10
- package/build/cjs/multi-select/features/position/index.js +15 -17
- package/build/cjs/multi-select/features/shows_selections/index.js +5 -7
- package/build/cjs/multi-select-field/features/accepts_help_text/index.js +3 -3
- package/build/cjs/multi-select-field/features/accepts_label/index.js +3 -3
- package/build/cjs/multi-select-field/features/accepts_validation_text/index.js +3 -3
- package/build/cjs/multi-select-field/features/can_be_required/index.js +3 -3
- package/build/cjs/multi-select-field/features/has_default_clear_text/index.js +4 -4
- package/build/cjs/multi-select-field/features/has_default_empty_text/index.js +4 -4
- package/build/cjs/multi-select-field/features/has_default_filter_nomatch_text/index.js +5 -5
- package/build/cjs/multi-select-field/features/has_default_filter_placeholder/index.js +4 -4
- package/build/cjs/multi-select-field/features/has_default_loading_text/index.js +4 -4
- package/build/cjs/single-select/features/accepts_blur_cb/index.js +3 -5
- package/build/cjs/single-select/features/accepts_focus_cb/index.js +3 -5
- package/build/cjs/single-select/features/accepts_initial_focus/index.js +2 -4
- package/build/cjs/single-select/features/accepts_loading/index.js +5 -7
- package/build/cjs/single-select/features/accepts_max_height/index.js +5 -10
- package/build/cjs/single-select/features/accepts_placeholder/index.js +6 -8
- package/build/cjs/single-select/features/accepts_prefix/index.js +5 -7
- package/build/cjs/single-select/features/allows_invalid_options/index.js +6 -8
- package/build/cjs/single-select/features/allows_selecting/index.js +7 -9
- package/build/cjs/single-select/features/can_be_cleared/index.js +4 -6
- package/build/cjs/single-select/features/can_be_disabled/index.js +9 -11
- package/build/cjs/single-select/features/can_be_empty/index.js +7 -9
- package/build/cjs/single-select/features/can_be_filtered/index.js +6 -8
- package/build/cjs/single-select/features/can_be_opened_and_closed/index.js +8 -10
- package/build/cjs/single-select/features/common/index.js +9 -9
- package/build/cjs/single-select/features/duplicate_option_values/index.js +6 -8
- package/build/cjs/single-select/features/menu_width_matches_input/index.js +8 -10
- package/build/cjs/single-select/features/position/index.js +10 -10
- package/build/cjs/single-select/features/shows_selections/index.js +3 -5
- package/build/cjs/single-select-field/features/accepts_help_text/index.js +3 -3
- package/build/cjs/single-select-field/features/accepts_label/index.js +3 -3
- package/build/cjs/single-select-field/features/accepts_validation_text/index.js +3 -3
- package/build/cjs/single-select-field/features/can_be_required/index.js +3 -3
- package/build/cjs/single-select-field/features/has_default_clear_text/index.js +4 -4
- package/build/cjs/single-select-field/features/has_default_empty_text/index.js +4 -4
- package/build/cjs/single-select-field/features/has_default_filter_nomatch_text/index.js +5 -5
- package/build/cjs/single-select-field/features/has_default_filter_placeholder/index.js +4 -4
- package/build/cjs/single-select-field/features/has_default_loading_text/index.js +4 -4
- package/build/es/multi-select/features/accepts_blur_cb/index.js +1 -2
- package/build/es/multi-select/features/accepts_focus_cb/index.js +1 -2
- package/build/es/multi-select/features/accepts_initial_focus/index.js +1 -2
- package/build/es/multi-select/features/accepts_loading/index.js +1 -2
- package/build/es/multi-select/features/accepts_max_height/index.js +1 -5
- package/build/es/multi-select/features/accepts_placeholder/index.js +1 -2
- package/build/es/multi-select/features/accepts_prefix/index.js +1 -2
- package/build/es/multi-select/features/allows_invalid_options/index.js +1 -2
- package/build/es/multi-select/features/allows_selecting/index.js +3 -4
- package/build/es/multi-select/features/can_be_cleared/index.js +1 -2
- package/build/es/multi-select/features/can_be_disabled/index.js +1 -5
- package/build/es/multi-select/features/can_be_empty/index.js +1 -2
- package/build/es/multi-select/features/can_be_filtered/index.js +1 -2
- package/build/es/multi-select/features/can_be_opened_and_closed/index.js +1 -2
- package/build/es/multi-select/features/common/index.js +1 -1
- package/build/es/multi-select/features/duplicate_option_values/index.js +1 -2
- package/build/es/multi-select/features/menu_width_matches_input/index.js +1 -2
- package/build/es/multi-select/features/position/index.js +1 -2
- package/build/es/multi-select/features/shows_selections/index.js +1 -2
- package/build/es/multi-select-field/features/accepts_help_text/index.js +1 -1
- package/build/es/multi-select-field/features/accepts_label/index.js +1 -1
- package/build/es/multi-select-field/features/accepts_validation_text/index.js +1 -1
- package/build/es/multi-select-field/features/can_be_required/index.js +1 -1
- package/build/es/multi-select-field/features/has_default_clear_text/index.js +1 -1
- package/build/es/multi-select-field/features/has_default_empty_text/index.js +1 -1
- package/build/es/multi-select-field/features/has_default_filter_nomatch_text/index.js +1 -1
- package/build/es/multi-select-field/features/has_default_filter_placeholder/index.js +1 -1
- package/build/es/multi-select-field/features/has_default_loading_text/index.js +1 -1
- package/build/es/single-select/features/accepts_blur_cb/index.js +1 -2
- package/build/es/single-select/features/accepts_focus_cb/index.js +1 -2
- package/build/es/single-select/features/accepts_initial_focus/index.js +1 -2
- package/build/es/single-select/features/accepts_loading/index.js +1 -2
- package/build/es/single-select/features/accepts_max_height/index.js +1 -5
- package/build/es/single-select/features/accepts_placeholder/index.js +1 -2
- package/build/es/single-select/features/accepts_prefix/index.js +1 -2
- package/build/es/single-select/features/allows_invalid_options/index.js +1 -2
- package/build/es/single-select/features/allows_selecting/index.js +1 -2
- package/build/es/single-select/features/can_be_cleared/index.js +1 -2
- package/build/es/single-select/features/can_be_disabled/index.js +1 -2
- package/build/es/single-select/features/can_be_empty/index.js +1 -2
- package/build/es/single-select/features/can_be_filtered/index.js +1 -2
- package/build/es/single-select/features/can_be_opened_and_closed/index.js +1 -2
- package/build/es/single-select/features/common/index.js +1 -1
- package/build/es/single-select/features/duplicate_option_values/index.js +3 -4
- package/build/es/single-select/features/menu_width_matches_input/index.js +1 -2
- package/build/es/single-select/features/position/index.js +1 -1
- package/build/es/single-select/features/shows_selections/index.js +1 -2
- package/build/es/single-select-field/features/accepts_help_text/index.js +1 -1
- package/build/es/single-select-field/features/accepts_label/index.js +1 -1
- package/build/es/single-select-field/features/accepts_validation_text/index.js +1 -1
- package/build/es/single-select-field/features/can_be_required/index.js +1 -1
- package/build/es/single-select-field/features/has_default_clear_text/index.js +1 -1
- package/build/es/single-select-field/features/has_default_empty_text/index.js +1 -1
- package/build/es/single-select-field/features/has_default_filter_nomatch_text/index.js +1 -1
- package/build/es/single-select-field/features/has_default_filter_placeholder/index.js +1 -1
- package/build/es/single-select-field/features/has_default_loading_text/index.js +1 -1
- package/package.json +15 -15
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(0, _steps.Given)('a filterable SingleSelect with options is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a filterable SingleSelect with options is rendered', () => {
|
|
8
6
|
cy.visitStory('SingleSelect', 'With filter field');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.When)('the user enters a filter string', () => {
|
|
11
9
|
cy.focused().type('one');
|
|
12
10
|
});
|
|
13
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.When)("the user enters a filter string that doesn't match any options", () => {
|
|
14
12
|
cy.focused().type('does not exist');
|
|
15
13
|
});
|
|
16
|
-
(0,
|
|
14
|
+
(0, _cypressCucumberPreprocessor.Then)('the matching options are displayed', () => {
|
|
17
15
|
cy.contains('option one').should('be.visible');
|
|
18
16
|
cy.contains('option two').should('not.exist');
|
|
19
17
|
cy.contains('option three').should('not.exist');
|
|
20
18
|
});
|
|
21
|
-
(0,
|
|
19
|
+
(0, _cypressCucumberPreprocessor.Then)('the no match text is displayed', () => {
|
|
22
20
|
cy.contains('No match found').should('be.visible');
|
|
23
21
|
});
|
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(0, _steps.Given)('a SingleSelect with options is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a SingleSelect with options is rendered', () => {
|
|
8
6
|
cy.visitStory('SingleSelect', 'With options');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('the SingleSelect is closed', () => {
|
|
11
9
|
cy.contains('option one').should('not.exist');
|
|
12
10
|
cy.contains('option two').should('not.exist');
|
|
13
11
|
cy.contains('option three').should('not.exist');
|
|
14
12
|
});
|
|
15
|
-
(0,
|
|
13
|
+
(0, _cypressCucumberPreprocessor.Given)('the SingleSelect is focused', () => {
|
|
16
14
|
cy.get('[data-test="dhis2-uicore-select-input"]').focus();
|
|
17
15
|
cy.focused().should('have.attr', 'data-test', 'dhis2-uicore-select-input');
|
|
18
16
|
});
|
|
19
|
-
(0,
|
|
17
|
+
(0, _cypressCucumberPreprocessor.When)('the down arrowkey is pressed on the focused element', () => {
|
|
20
18
|
cy.focused().type('{downarrow}');
|
|
21
19
|
});
|
|
22
|
-
(0,
|
|
20
|
+
(0, _cypressCucumberPreprocessor.When)('the spacebar is pressed on the focused element', () => {
|
|
23
21
|
cy.focused().type(' ');
|
|
24
22
|
});
|
|
25
|
-
(0,
|
|
23
|
+
(0, _cypressCucumberPreprocessor.When)('the up arrowkey is pressed on the focused element', () => {
|
|
26
24
|
cy.focused().type('{uparrow}');
|
|
27
25
|
});
|
|
28
|
-
(0,
|
|
26
|
+
(0, _cypressCucumberPreprocessor.When)('the escape key is pressed on the focused element', () => {
|
|
29
27
|
cy.focused().type('{esc}');
|
|
30
28
|
});
|
|
@@ -1,35 +1,35 @@
|
|
|
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 SingleSelect with options and onChange handler is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelect', 'With options and onChange');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('a SingleSelect with options, a selection and onChange handler is rendered', () => {
|
|
9
9
|
cy.visitStory('SingleSelect', 'With options, a selection and onChange');
|
|
10
10
|
});
|
|
11
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Given)('the SingleSelect is open', () => {
|
|
12
12
|
cy.get('[data-test="dhis2-uicore-select-input"]').click();
|
|
13
13
|
cy.contains('option one').should('exist');
|
|
14
14
|
cy.contains('option two').should('exist');
|
|
15
15
|
cy.contains('option three').should('exist');
|
|
16
16
|
});
|
|
17
|
-
(0,
|
|
17
|
+
(0, _cypressCucumberPreprocessor.When)('the SingleSelect input is clicked', () => {
|
|
18
18
|
cy.get('[data-test="dhis2-uicore-select-input"]').click();
|
|
19
19
|
});
|
|
20
|
-
(0,
|
|
20
|
+
(0, _cypressCucumberPreprocessor.When)('the user clicks the backdrop layer', () => {
|
|
21
21
|
cy.get('[data-test="dhis2-uicore-layer"]').click();
|
|
22
22
|
});
|
|
23
|
-
(0,
|
|
23
|
+
(0, _cypressCucumberPreprocessor.Then)('the options are not rendered', () => {
|
|
24
24
|
cy.contains('option one').should('not.exist');
|
|
25
25
|
cy.contains('option two').should('not.exist');
|
|
26
26
|
cy.contains('option three').should('not.exist');
|
|
27
27
|
});
|
|
28
|
-
(0,
|
|
28
|
+
(0, _cypressCucumberPreprocessor.Then)('the options are displayed', () => {
|
|
29
29
|
cy.contains('option one').should('be.visible');
|
|
30
30
|
cy.contains('option two').should('be.visible');
|
|
31
31
|
cy.contains('option three').should('be.visible');
|
|
32
32
|
});
|
|
33
|
-
(0,
|
|
33
|
+
(0, _cypressCucumberPreprocessor.Then)('the SingleSelect has focus', () => {
|
|
34
34
|
cy.focused().should('have.attr', 'data-test', 'dhis2-uicore-select-input');
|
|
35
35
|
});
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(0, _steps.Given)('a SingleSelect with options with a duplicate value and this value is selected', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a SingleSelect with options with a duplicate value and this value is selected', () => {
|
|
8
6
|
cy.visitStory('SingleSelect', 'With duplicate selected option values');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Then)('the first option with the selected value is displayed in the input', () => {
|
|
11
9
|
cy.get('[data-test="dhis2-uicore-select-input"]').should('contain', 'option one');
|
|
12
10
|
});
|
|
13
|
-
(0,
|
|
14
|
-
cy.get('[data-test="dhis2-uicore-singleselectoption"]
|
|
15
|
-
cy.get('[data-test="dhis2-uicore-singleselectoption"]
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Then)('both options are highlighted in the dropdown', () => {
|
|
12
|
+
cy.get('[data-test="dhis2-uicore-singleselectoption"]:contains("option one")').should('have.class', 'active');
|
|
13
|
+
cy.get('[data-test="dhis2-uicore-singleselectoption"]:contains("option one a")').should('have.class', 'active');
|
|
16
14
|
});
|
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(0, _steps.Given)('a SingleSelect with hidden sibling elements', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a SingleSelect with hidden sibling elements', () => {
|
|
8
6
|
cy.visitStory('SingleSelect', 'Menu width changing');
|
|
9
7
|
cy.get('[data-test="dhis2-uicore-singleselect"]').then($el => {
|
|
10
8
|
cy.wrap($el.outerWidth()).as('originalWidth');
|
|
11
9
|
});
|
|
12
10
|
});
|
|
13
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.When)('the button is clicked', () => {
|
|
14
12
|
cy.get('button').click();
|
|
15
13
|
});
|
|
16
|
-
(0,
|
|
14
|
+
(0, _cypressCucumberPreprocessor.Then)('the siblings are displayed', () => {
|
|
17
15
|
cy.get('.toggler').should('exist').and('have.length', 2);
|
|
18
16
|
});
|
|
19
|
-
(0,
|
|
17
|
+
(0, _cypressCucumberPreprocessor.Then)('the menu width has decreased', () => {
|
|
20
18
|
cy.get('[data-test="dhis2-uicore-singleselect"]').then($el => {
|
|
21
19
|
const newWidth = $el.outerWidth();
|
|
22
20
|
cy.get('@originalWidth').should('be.greaterThan', newWidth);
|
|
23
21
|
});
|
|
24
22
|
});
|
|
25
|
-
(0,
|
|
23
|
+
(0, _cypressCucumberPreprocessor.When)('the SingleSelect menu is open', () => {
|
|
26
24
|
cy.get('[data-test="dhis2-uicore-select-menu-menuwrapper"]').should('be.visible');
|
|
27
25
|
});
|
|
28
|
-
(0,
|
|
26
|
+
(0, _cypressCucumberPreprocessor.Then)('the SingleSelect input is left aligned with the menu', () => {
|
|
29
27
|
const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
|
|
30
28
|
const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
|
|
31
29
|
cy.getAll(selectDataTest, menuDataTest).should(_ref => {
|
|
@@ -39,7 +37,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
39
37
|
expect(Math.round(inputRect.left)).to.equal(Math.round(menuRect.left));
|
|
40
38
|
});
|
|
41
39
|
});
|
|
42
|
-
(0,
|
|
40
|
+
(0, _cypressCucumberPreprocessor.When)('the SingleSelect input and menu have the same width', () => {
|
|
43
41
|
const inputSelector = '[data-test="dhis2-uicore-select"]';
|
|
44
42
|
const menuSelector = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
|
|
45
43
|
cy.getAll(inputSelector, menuSelector).should(_ref2 => {
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('there is enough space below the anchor to fit the SingleSelect menu', () => {
|
|
6
6
|
cy.visitStory('SingleSelect', 'Default position');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('there is not enough space below the anchor to fit the SingleSelect menu', () => {
|
|
9
9
|
cy.visitStory('SingleSelect', 'Flipped position');
|
|
10
10
|
});
|
|
11
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Given)('there is not enough space above or below the anchor to fit the SingleSelect menu', () => {
|
|
12
12
|
cy.visitStory('SingleSelect', 'Shifted into view');
|
|
13
13
|
});
|
|
14
|
-
(0,
|
|
14
|
+
(0, _cypressCucumberPreprocessor.When)('the SingleSelect is clicked', () => {
|
|
15
15
|
cy.get('[data-test="dhis2-uicore-singleselect"]').click();
|
|
16
16
|
});
|
|
17
|
-
(0,
|
|
17
|
+
(0, _cypressCucumberPreprocessor.When)('the window is scrolled down', () => {
|
|
18
18
|
// Ensure the body can scroll first
|
|
19
19
|
cy.get('body').then($body => {
|
|
20
20
|
$body.height('5000px');
|
|
21
21
|
});
|
|
22
22
|
cy.scrollTo(0, 800);
|
|
23
23
|
});
|
|
24
|
-
(0,
|
|
24
|
+
(0, _cypressCucumberPreprocessor.Then)('the top of the menu is aligned with the bottom of the input', () => {
|
|
25
25
|
const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
|
|
26
26
|
const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
|
|
27
27
|
cy.getAll(selectDataTest, menuDataTest).should(_ref => {
|
|
@@ -35,7 +35,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
35
35
|
expect(menuRect.top).to.equal(selectRect.bottom);
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
|
-
(0,
|
|
38
|
+
(0, _cypressCucumberPreprocessor.Then)('the bottom of the menu is aligned with the top of the input', () => {
|
|
39
39
|
const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
|
|
40
40
|
const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
|
|
41
41
|
cy.getAll(selectDataTest, menuDataTest).should(_ref2 => {
|
|
@@ -49,7 +49,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
49
49
|
expect(selectRect.top).to.equal(menuRect.bottom);
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
|
-
(0,
|
|
52
|
+
(0, _cypressCucumberPreprocessor.Then)('it is rendered on top of the SingleSelect', () => {
|
|
53
53
|
const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
|
|
54
54
|
const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
|
|
55
55
|
cy.getAll(selectDataTest, menuDataTest).should(_ref3 => {
|
|
@@ -64,7 +64,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
64
64
|
expect(menuRect.bottom).to.be.greaterThan(selectRect.bottom);
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
|
-
(0,
|
|
67
|
+
(0, _cypressCucumberPreprocessor.Then)('the left of the SingleSelect is aligned with the left of the anchor', () => {
|
|
68
68
|
const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
|
|
69
69
|
const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
|
|
70
70
|
cy.getAll(selectDataTest, menuDataTest).should(_ref4 => {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(0, _steps.Given)('a SingleSelect with options and a selection is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a SingleSelect with options and a selection is rendered', () => {
|
|
8
6
|
cy.visitStory('SingleSelect', 'With options and a selection');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Then)('the selection is displayed', () => {
|
|
11
9
|
cy.contains('option one').should('be.visible');
|
|
12
10
|
});
|
|
@@ -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 SingleSelectField with help text is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelectField', 'With help text');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Then)('the help text is visible', () => {
|
|
9
9
|
cy.contains('The help text').should('be.visible');
|
|
10
10
|
});
|
|
@@ -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 SingleSelectField with a label is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelectField', 'With label');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Then)('the label is visible', () => {
|
|
9
9
|
cy.contains('The label').should('be.visible');
|
|
10
10
|
});
|
|
@@ -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 SingleSelectField with validation text is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelectField', 'With validation text');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Then)('the validation text is visible', () => {
|
|
9
9
|
cy.contains('The validation text').should('be.visible');
|
|
10
10
|
});
|
|
@@ -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 SingleSelectField with label and a required flag is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelectField', 'With label and required status');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Then)('the required indicator is visible', () => {
|
|
9
9
|
cy.get('[data-test="dhis2-uiwidgets-singleselectfield-label-required"]').should('be.visible');
|
|
10
10
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
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 clearable SingleSelectField with selected option is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelectField', 'With clearable and selected option');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.When)('the clear button is hovered', () => {
|
|
9
9
|
cy.get('[data-test="dhis2-uicore-singleselect-clear"]').trigger('mouseover', 'top');
|
|
10
10
|
});
|
|
11
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Then)('the clear text is visible', () => {
|
|
12
12
|
cy.contains('Clear').should('be.visible');
|
|
13
13
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('an empty SingleSelectField is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelectField', 'Without options');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.When)('the Select is opened', () => {
|
|
9
9
|
cy.get('[data-test="dhis2-uicore-select-input"]').click();
|
|
10
10
|
});
|
|
11
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Then)('the empty text is visible', () => {
|
|
12
12
|
cy.contains('No data found').should('be.visible');
|
|
13
13
|
});
|
|
@@ -1,16 +1,16 @@
|
|
|
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 filterable SingleSelectField is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelectField', 'With filterable');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.When)('the Select is opened', () => {
|
|
9
9
|
cy.get('[data-test="dhis2-uicore-select-input"]').click();
|
|
10
10
|
});
|
|
11
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.When)('a filter that does not match any options is entered', () => {
|
|
12
12
|
cy.focused().type('Two');
|
|
13
13
|
});
|
|
14
|
-
(0,
|
|
14
|
+
(0, _cypressCucumberPreprocessor.Then)('the no match text is visible', () => {
|
|
15
15
|
cy.contains('No options found').should('be.visible');
|
|
16
16
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
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 filterable SingleSelectField is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelectField', 'With filterable');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.When)('the Select is opened', () => {
|
|
9
9
|
cy.get('[data-test="dhis2-uicore-select-input"]').click();
|
|
10
10
|
});
|
|
11
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Then)('the filter placeholder exists', () => {
|
|
12
12
|
cy.get('[data-test="dhis2-uicore-singleselect-filterinput"] [placeholder="Type to filter options"]').should('exist');
|
|
13
13
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
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 loading SingleSelectField is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelectField', 'With loading');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.When)('the Select is opened', () => {
|
|
9
9
|
cy.get('[data-test="dhis2-uicore-select-input"]').click();
|
|
10
10
|
});
|
|
11
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Then)('the loading text is visible', () => {
|
|
12
12
|
cy.contains('Loading options').should('be.visible');
|
|
13
13
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with onBlur handler is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With onBlur');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with onFocus handler is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With onFocus');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with initial focus is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With initialFocus');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with options and a loading flag is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With options and loading');
|
|
5
4
|
});
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with more than ten options is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With more than ten options');
|
|
5
4
|
});
|
|
6
5
|
Given('a MultiSelect with more than three options and a 100px max-height is rendered', () => {
|
|
7
6
|
cy.visitStory('MultiSelect', 'With more than three options and a 100px max-height');
|
|
8
7
|
});
|
|
9
|
-
Given('the MultiSelect is open', () => {
|
|
10
|
-
cy.get('[data-test="dhis2-uicore-select"]').click();
|
|
11
|
-
});
|
|
12
8
|
Then('has the default max-height', () => {
|
|
13
9
|
cy.get('[data-test="dhis2-uicore-select-menu-menuwrapper"]').should('have.css', 'max-height', '280px');
|
|
14
10
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with a placeholder and no selection is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With placeholder');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with a prefix and no selection is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With prefix');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with invalid options is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With invalid options');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with a disabled option and onChange handler is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With disabled option and onChange');
|
|
5
4
|
});
|
|
@@ -10,7 +9,7 @@ When('an option is clicked', () => {
|
|
|
10
9
|
cy.contains('option one').click();
|
|
11
10
|
});
|
|
12
11
|
When('the selected option is clicked', () => {
|
|
13
|
-
cy.get('[data-test="dhis2-uicore-
|
|
12
|
+
cy.get('[data-test="dhis2-uicore-multiselectoption"]:contains("option one")').click();
|
|
14
13
|
});
|
|
15
14
|
When('another option is clicked', () => {
|
|
16
15
|
cy.contains('option two').click();
|
|
@@ -22,7 +21,7 @@ When('the disabled option is clicked', () => {
|
|
|
22
21
|
cy.contains('disabled option').click();
|
|
23
22
|
});
|
|
24
23
|
When('the selected option is clicked again', () => {
|
|
25
|
-
cy.get('[data-test="dhis2-uicore-multiselectoption"]
|
|
24
|
+
cy.get('[data-test="dhis2-uicore-multiselectoption"]:contains("option one")').click();
|
|
26
25
|
});
|
|
27
26
|
Then('the clicked option is selected', () => {
|
|
28
27
|
cy.window().should(win => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a clearable MultiSelect with a selection and onchange handler is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With clear button, selection and onChange');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a disabled MultiSelect with options is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With options and disabled');
|
|
5
4
|
});
|
|
@@ -15,9 +14,6 @@ Given('the MultiSelect is focused', () => {
|
|
|
15
14
|
cy.get('[data-test="dhis2-uicore-select-input"]').focus();
|
|
16
15
|
cy.focused().should('have.attr', 'data-test', 'dhis2-uicore-select-input');
|
|
17
16
|
});
|
|
18
|
-
When('the MultiSelect input is clicked', () => {
|
|
19
|
-
cy.get('[data-test="dhis2-uicore-select-input"]').click();
|
|
20
|
-
});
|
|
21
17
|
When('the down arrowkey is pressed on the focused element', () => {
|
|
22
18
|
cy.focused().type('{downarrow}');
|
|
23
19
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a filterable MultiSelect with options is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With filter field');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with options is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With options');
|
|
5
4
|
});
|
|
@@ -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 MultiSelect with options and onChange handler is rendered', () => {
|
|
3
3
|
cy.visitStory('MultiSelect', 'With options and onChange');
|
|
4
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with options with a duplicate value and this value is selected', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With duplicate selected option values');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with hidden sibling elements', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'Menu width changing');
|
|
5
4
|
cy.get('[data-test="dhis2-uicore-multiselect"]').then($el => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, Then, When } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, Then, When } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('there is enough space below the anchor to fit the MultiSelect menu', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'Default position');
|
|
5
4
|
});
|