@dhis2-ui/select 9.5.0-alpha.1 → 9.5.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/locales/lo/translations.json +3 -3
- 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/input.js +6 -6
- 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 +6 -3
- package/build/cjs/multi-select-field/features/has_default_clear_text.feature +1 -0
- 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/select/input-clear-button.js +26 -7
- 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/input.js +6 -6
- 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 +6 -3
- package/build/cjs/single-select-field/features/has_default_clear_text.feature +1 -0
- 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/locales/lo/translations.json +3 -3
- 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/input.js +6 -6
- 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 +4 -1
- package/build/es/multi-select-field/features/has_default_clear_text.feature +1 -0
- 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/select/input-clear-button.js +24 -7
- 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/input.js +6 -6
- 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 +4 -1
- package/build/es/single-select-field/features/has_default_clear_text.feature +1 -0
- 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 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"Clear": "ລຶບ",
|
|
3
3
|
"No data found": "ບໍ່ພົບຂໍ້ມູນ",
|
|
4
|
-
"Type to filter options": "",
|
|
5
|
-
"Loading options": "",
|
|
6
|
-
"No options found": ""
|
|
4
|
+
"Type to filter options": "ປະເພດຕົວເລືອກການກອງ",
|
|
5
|
+
"Loading options": "ໂຫຼດຕົວເລືອກ",
|
|
6
|
+
"No options found": "ບໍ່ພົບຕົວເລືອກ"
|
|
7
7
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
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 MultiSelect with onBlur handler is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with onBlur handler is rendered', () => {
|
|
8
6
|
cy.visitStory('MultiSelect', 'With onBlur');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Then)('the onBlur handler is called', () => {
|
|
11
9
|
cy.window().should(win => {
|
|
12
10
|
expect(win.onBlur).to.be.calledOnce;
|
|
13
11
|
expect(win.onBlur).to.be.calledWith({
|
|
@@ -1,13 +1,11 @@
|
|
|
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 MultiSelect with onFocus handler is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with onFocus handler is rendered', () => {
|
|
8
6
|
cy.visitStory('MultiSelect', 'With onFocus');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Then)('the onFocus handler is called', () => {
|
|
11
9
|
cy.window().should(win => {
|
|
12
10
|
expect(win.onFocus).to.be.calledOnce;
|
|
13
11
|
expect(win.onFocus).to.be.calledWith({
|
|
@@ -1,9 +1,7 @@
|
|
|
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 MultiSelect with initial focus is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with initial focus is rendered', () => {
|
|
8
6
|
cy.visitStory('MultiSelect', 'With initialFocus');
|
|
9
7
|
});
|
|
@@ -1,18 +1,16 @@
|
|
|
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 MultiSelect with options and a loading flag is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with options and a loading flag is rendered', () => {
|
|
8
6
|
cy.visitStory('MultiSelect', 'With options and loading');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with options, a loading flag and a loading text is rendered', () => {
|
|
11
9
|
cy.visitStory('MultiSelect', 'With options, loading and loading text');
|
|
12
10
|
});
|
|
13
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Then)('the loading spinner is displayed', () => {
|
|
14
12
|
cy.get('[data-test="dhis2-uicore-circularloader"]').should('be.visible');
|
|
15
13
|
});
|
|
16
|
-
(0,
|
|
14
|
+
(0, _cypressCucumberPreprocessor.Then)('the loading text is displayed', () => {
|
|
17
15
|
cy.get('[data-test="dhis2-uicore-multiselect-loading"]').contains('Loading options').should('be.visible');
|
|
18
16
|
});
|
|
@@ -1,21 +1,16 @@
|
|
|
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 MultiSelect with more than ten options is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with more than ten options is rendered', () => {
|
|
8
6
|
cy.visitStory('MultiSelect', 'With more than ten options');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with more than three options and a 100px max-height is rendered', () => {
|
|
11
9
|
cy.visitStory('MultiSelect', 'With more than three options and a 100px max-height');
|
|
12
10
|
});
|
|
13
|
-
(0,
|
|
14
|
-
cy.get('[data-test="dhis2-uicore-select"]').click();
|
|
15
|
-
});
|
|
16
|
-
(0, _steps.Then)('has the default max-height', () => {
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Then)('has the default max-height', () => {
|
|
17
12
|
cy.get('[data-test="dhis2-uicore-select-menu-menuwrapper"]').should('have.css', 'max-height', '280px');
|
|
18
13
|
});
|
|
19
|
-
(0,
|
|
14
|
+
(0, _cypressCucumberPreprocessor.Then)('has a max-height of 100px', () => {
|
|
20
15
|
cy.get('[data-test="dhis2-uicore-select-menu-menuwrapper"]').should('have.css', 'max-height', '100px');
|
|
21
16
|
});
|
|
@@ -1,21 +1,19 @@
|
|
|
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 MultiSelect with a placeholder and no selection is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with a placeholder and no selection is rendered', () => {
|
|
8
6
|
cy.visitStory('MultiSelect', 'With placeholder');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with a placeholder and a selection is rendered', () => {
|
|
11
9
|
cy.visitStory('MultiSelect', 'With placeholder and selection');
|
|
12
10
|
});
|
|
13
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Then)('the placeholder is shown', () => {
|
|
14
12
|
cy.get('[data-test="dhis2-uicore-multiselect-placeholder"]').contains('Placeholder text').should('be.visible');
|
|
15
13
|
});
|
|
16
|
-
(0,
|
|
14
|
+
(0, _cypressCucumberPreprocessor.Then)('the placeholder is not rendered', () => {
|
|
17
15
|
cy.get('[data-test="dhis2-uicore-multiselect-placeholder"]').should('not.exist');
|
|
18
16
|
});
|
|
19
|
-
(0,
|
|
17
|
+
(0, _cypressCucumberPreprocessor.Then)('the selection is displayed', () => {
|
|
20
18
|
cy.contains('option one').should('be.visible');
|
|
21
19
|
});
|
|
@@ -1,18 +1,16 @@
|
|
|
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 MultiSelect with a prefix and no selection is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with a prefix and no selection is rendered', () => {
|
|
8
6
|
cy.visitStory('MultiSelect', 'With prefix');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with a prefix and a selection is rendered', () => {
|
|
11
9
|
cy.visitStory('MultiSelect', 'With prefix and selection');
|
|
12
10
|
});
|
|
13
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Then)('the prefix is shown', () => {
|
|
14
12
|
cy.get('[data-test="dhis2-uicore-multiselect-prefix"]').contains('Prefix text').should('be.visible');
|
|
15
13
|
});
|
|
16
|
-
(0,
|
|
14
|
+
(0, _cypressCucumberPreprocessor.Then)('the selection is shown', () => {
|
|
17
15
|
cy.contains('option one').should('be.visible');
|
|
18
16
|
});
|
|
@@ -1,24 +1,22 @@
|
|
|
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 MultiSelect with invalid options is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with invalid options is rendered', () => {
|
|
8
6
|
cy.visitStory('MultiSelect', 'With invalid options');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with invalid filterable options is rendered', () => {
|
|
11
9
|
cy.visitStory('MultiSelect', 'With invalid filterable options');
|
|
12
10
|
});
|
|
13
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.When)('the user enters a filter string', () => {
|
|
14
12
|
cy.get('[data-test="dhis2-uicore-multiselect-filterinput"] input').type('invalid');
|
|
15
13
|
});
|
|
16
|
-
(0,
|
|
14
|
+
(0, _cypressCucumberPreprocessor.Then)('the invalid options are displayed', () => {
|
|
17
15
|
cy.contains('invalid one').should('be.visible');
|
|
18
16
|
cy.contains('invalid two').should('be.visible');
|
|
19
17
|
cy.contains('invalid three').should('be.visible');
|
|
20
18
|
});
|
|
21
|
-
(0,
|
|
19
|
+
(0, _cypressCucumberPreprocessor.Then)('the invalid options are not rendered', () => {
|
|
22
20
|
cy.contains('invalid one').should('not.exist');
|
|
23
21
|
cy.contains('invalid two').should('not.exist');
|
|
24
22
|
cy.contains('invalid three').should('not.exist');
|
|
@@ -1,34 +1,32 @@
|
|
|
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 MultiSelect with a disabled option and onChange handler is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with a disabled option and onChange handler is rendered', () => {
|
|
8
6
|
cy.visitStory('MultiSelect', 'With disabled option and onChange');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with custom options and onChange handler is rendered', () => {
|
|
11
9
|
cy.visitStory('MultiSelect', 'With custom options and onChange');
|
|
12
10
|
});
|
|
13
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.When)('an option is clicked', () => {
|
|
14
12
|
cy.contains('option one').click();
|
|
15
13
|
});
|
|
16
|
-
(0,
|
|
17
|
-
cy.get('[data-test="dhis2-uicore-
|
|
14
|
+
(0, _cypressCucumberPreprocessor.When)('the selected option is clicked', () => {
|
|
15
|
+
cy.get('[data-test="dhis2-uicore-multiselectoption"]:contains("option one")').click();
|
|
18
16
|
});
|
|
19
|
-
(0,
|
|
17
|
+
(0, _cypressCucumberPreprocessor.When)('another option is clicked', () => {
|
|
20
18
|
cy.contains('option two').click();
|
|
21
19
|
});
|
|
22
|
-
(0,
|
|
20
|
+
(0, _cypressCucumberPreprocessor.When)("the chip's X is clicked", () => {
|
|
23
21
|
cy.get('[data-test="dhis2-uicore-chip-remove"]').click();
|
|
24
22
|
});
|
|
25
|
-
(0,
|
|
23
|
+
(0, _cypressCucumberPreprocessor.When)('the disabled option is clicked', () => {
|
|
26
24
|
cy.contains('disabled option').click();
|
|
27
25
|
});
|
|
28
|
-
(0,
|
|
29
|
-
cy.get('[data-test="dhis2-uicore-multiselectoption"]
|
|
26
|
+
(0, _cypressCucumberPreprocessor.When)('the selected option is clicked again', () => {
|
|
27
|
+
cy.get('[data-test="dhis2-uicore-multiselectoption"]:contains("option one")').click();
|
|
30
28
|
});
|
|
31
|
-
(0,
|
|
29
|
+
(0, _cypressCucumberPreprocessor.Then)('the clicked option is selected', () => {
|
|
32
30
|
cy.window().should(win => {
|
|
33
31
|
expect(win.onChange).to.be.calledOnce;
|
|
34
32
|
expect(win.onChange).to.be.calledWith({
|
|
@@ -36,7 +34,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
36
34
|
});
|
|
37
35
|
});
|
|
38
36
|
});
|
|
39
|
-
(0,
|
|
37
|
+
(0, _cypressCucumberPreprocessor.Then)('the clicked option is selected as well', () => {
|
|
40
38
|
cy.window().should(win => {
|
|
41
39
|
expect(win.onChange).to.be.calledOnce;
|
|
42
40
|
expect(win.onChange).to.be.calledWith({
|
|
@@ -44,7 +42,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
44
42
|
});
|
|
45
43
|
});
|
|
46
44
|
});
|
|
47
|
-
(0,
|
|
45
|
+
(0, _cypressCucumberPreprocessor.Then)('the selected option is deselected', () => {
|
|
48
46
|
cy.window().should(win => {
|
|
49
47
|
expect(win.onChange).to.be.calledOnce;
|
|
50
48
|
expect(win.onChange).to.be.calledWith({
|
|
@@ -52,12 +50,12 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
52
50
|
});
|
|
53
51
|
});
|
|
54
52
|
});
|
|
55
|
-
(0,
|
|
53
|
+
(0, _cypressCucumberPreprocessor.Then)('the onchange handler is not called', () => {
|
|
56
54
|
cy.window().should(win => {
|
|
57
55
|
expect(win.onChange).to.not.be.called;
|
|
58
56
|
});
|
|
59
57
|
});
|
|
60
|
-
(0,
|
|
58
|
+
(0, _cypressCucumberPreprocessor.Then)('the previously selected option is deselected', () => {
|
|
61
59
|
cy.window().should(win => {
|
|
62
60
|
expect(win.onChange).to.be.calledTwice;
|
|
63
61
|
expect(win.onChange).to.be.calledWith({
|
|
@@ -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 clearable MultiSelect with a selection and onchange handler is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a clearable MultiSelect with a selection and onchange handler is rendered', () => {
|
|
8
6
|
cy.visitStory('MultiSelect', 'With clear button, selection and onChange');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.When)('the clear button is clicked', () => {
|
|
11
9
|
cy.get('[data-test="dhis2-uicore-multiselect-clear"]').click();
|
|
12
10
|
});
|
|
13
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Then)('the MultiSelect is cleared', () => {
|
|
14
12
|
cy.window().should(win => {
|
|
15
13
|
expect(win.onChange).to.be.calledOnce;
|
|
16
14
|
expect(win.onChange).to.be.calledWith({
|
|
@@ -1,36 +1,31 @@
|
|
|
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 disabled MultiSelect with options is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a disabled MultiSelect with options is rendered', () => {
|
|
8
6
|
cy.visitStory('MultiSelect', 'With options and disabled');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('a disabled MultiSelect with options and a selection is rendered', () => {
|
|
11
9
|
cy.visitStory('MultiSelect', 'With options, a selection and disabled');
|
|
12
10
|
});
|
|
13
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Given)('the MultiSelect is closed', () => {
|
|
14
12
|
cy.contains('option one').should('not.exist');
|
|
15
13
|
cy.contains('option two').should('not.exist');
|
|
16
14
|
cy.contains('option three').should('not.exist');
|
|
17
15
|
});
|
|
18
|
-
(0,
|
|
16
|
+
(0, _cypressCucumberPreprocessor.Given)('the MultiSelect is focused', () => {
|
|
19
17
|
cy.get('[data-test="dhis2-uicore-select-input"]').focus();
|
|
20
18
|
cy.focused().should('have.attr', 'data-test', 'dhis2-uicore-select-input');
|
|
21
19
|
});
|
|
22
|
-
(0,
|
|
23
|
-
cy.get('[data-test="dhis2-uicore-select-input"]').click();
|
|
24
|
-
});
|
|
25
|
-
(0, _steps.When)('the down arrowkey is pressed on the focused element', () => {
|
|
20
|
+
(0, _cypressCucumberPreprocessor.When)('the down arrowkey is pressed on the focused element', () => {
|
|
26
21
|
cy.focused().type('{downarrow}');
|
|
27
22
|
});
|
|
28
|
-
(0,
|
|
23
|
+
(0, _cypressCucumberPreprocessor.When)('the spacebar is pressed on the focused element', () => {
|
|
29
24
|
cy.focused().type(' ');
|
|
30
25
|
});
|
|
31
|
-
(0,
|
|
26
|
+
(0, _cypressCucumberPreprocessor.When)('the up arrowkey is pressed on the focused element', () => {
|
|
32
27
|
cy.focused().type('{uparrow}');
|
|
33
28
|
});
|
|
34
|
-
(0,
|
|
29
|
+
(0, _cypressCucumberPreprocessor.Then)('the selection is displayed', () => {
|
|
35
30
|
cy.contains('option one').should('be.visible');
|
|
36
31
|
});
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(0, _steps.Given)('an empty MultiSelect is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('an empty MultiSelect is rendered', () => {
|
|
8
6
|
cy.visitStory('MultiSelect', 'Empty');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('an empty MultiSelect with custom empty text is rendered', () => {
|
|
11
9
|
cy.visitStory('MultiSelect', 'Empty with empty text');
|
|
12
10
|
});
|
|
13
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Given)('an empty MultiSelect with custom empty component is rendered', () => {
|
|
14
12
|
cy.visitStory('MultiSelect', 'Empty with empty component');
|
|
15
13
|
});
|
|
16
|
-
(0,
|
|
14
|
+
(0, _cypressCucumberPreprocessor.Then)('an empty menu is displayed', () => {
|
|
17
15
|
cy.get('[data-test="dhis2-uicore-layer"]').should('exist');
|
|
18
16
|
});
|
|
19
|
-
(0,
|
|
17
|
+
(0, _cypressCucumberPreprocessor.Then)('the custom empty text is displayed', () => {
|
|
20
18
|
cy.get('[data-test="dhis2-uicore-multiselect-empty"]').contains('Custom empty text').should('be.visible');
|
|
21
19
|
});
|
|
22
|
-
(0,
|
|
20
|
+
(0, _cypressCucumberPreprocessor.Then)('the custom empty component is displayed', () => {
|
|
23
21
|
cy.contains('Custom empty component').should('be.visible');
|
|
24
22
|
cy.get('.custom-empty').should('exist');
|
|
25
23
|
});
|
|
@@ -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 MultiSelect with options is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a filterable MultiSelect with options is rendered', () => {
|
|
8
6
|
cy.visitStory('MultiSelect', '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 MultiSelect with options is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with options is rendered', () => {
|
|
8
6
|
cy.visitStory('MultiSelect', 'With options');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('the MultiSelect 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 MultiSelect 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,39 +1,39 @@
|
|
|
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 MultiSelect with options and onChange handler is rendered', () => {
|
|
6
6
|
cy.visitStory('MultiSelect', 'With options and onChange');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with options, a selection and onChange handler is rendered', () => {
|
|
9
9
|
cy.visitStory('MultiSelect', 'With options, a selection and onChange');
|
|
10
10
|
});
|
|
11
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect is rendered to which options can be added', () => {
|
|
12
12
|
cy.visitStory('MultiSelect', 'With options that can be added to the input');
|
|
13
13
|
cy.get('[data-test="dhis2-uicore-multiselect"]').should('exist');
|
|
14
14
|
});
|
|
15
|
-
(0,
|
|
15
|
+
(0, _cypressCucumberPreprocessor.Given)('the MultiSelect is open', () => {
|
|
16
16
|
cy.get('[data-test="dhis2-uicore-select-input"]').click();
|
|
17
17
|
cy.contains('option one').should('be.visible');
|
|
18
18
|
cy.contains('option two').should('be.visible');
|
|
19
19
|
cy.contains('option three').should('be.visible');
|
|
20
20
|
});
|
|
21
|
-
(0,
|
|
21
|
+
(0, _cypressCucumberPreprocessor.When)('the MultiSelect input is clicked', () => {
|
|
22
22
|
cy.get('[data-test="dhis2-uicore-select-input"]').click();
|
|
23
23
|
});
|
|
24
|
-
(0,
|
|
24
|
+
(0, _cypressCucumberPreprocessor.When)('the user clicks the backdrop layer', () => {
|
|
25
25
|
cy.get('[data-test="dhis2-uicore-layer"]').click();
|
|
26
26
|
});
|
|
27
|
-
(0,
|
|
27
|
+
(0, _cypressCucumberPreprocessor.Then)('the options are not rendered', () => {
|
|
28
28
|
cy.contains('option one').should('not.exist');
|
|
29
29
|
cy.contains('option two').should('not.exist');
|
|
30
30
|
cy.contains('option three').should('not.exist');
|
|
31
31
|
});
|
|
32
|
-
(0,
|
|
32
|
+
(0, _cypressCucumberPreprocessor.Then)('the options are displayed', () => {
|
|
33
33
|
cy.contains('option one').should('be.visible');
|
|
34
34
|
cy.contains('option two').should('be.visible');
|
|
35
35
|
cy.contains('option three').should('be.visible');
|
|
36
36
|
});
|
|
37
|
-
(0,
|
|
37
|
+
(0, _cypressCucumberPreprocessor.Then)('the MultiSelect has focus', () => {
|
|
38
38
|
cy.focused().should('have.attr', 'data-test', 'dhis2-uicore-select-input');
|
|
39
39
|
});
|
|
@@ -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 MultiSelect with options with a duplicate value and this value is selected', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with options with a duplicate value and this value is selected', () => {
|
|
8
6
|
cy.visitStory('MultiSelect', '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,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Then)('both options are highlighted in the dropdown', () => {
|
|
14
12
|
cy.get('input[name="option one"]').should('have.attr', 'checked');
|
|
15
13
|
cy.get('input[name="option one a"]').should('have.attr', 'checked');
|
|
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 MultiSelect with hidden sibling elements', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a MultiSelect with hidden sibling elements', () => {
|
|
8
6
|
cy.visitStory('MultiSelect', 'Menu width changing');
|
|
9
7
|
cy.get('[data-test="dhis2-uicore-multiselect"]').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-multiselect"]').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 MultiSelect 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 MultiSelect input is left aligned with the menu', () => {
|
|
29
27
|
const selectDataTest = '[data-test="dhis2-uicore-multiselect"]';
|
|
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 MultiSelect 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 => {
|