@elastic/eui 71.0.0 → 71.1.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/README.md +0 -7
- package/dist/eui_theme_dark.css +7694 -5793
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +7736 -5835
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/datagrid/data_grid.a11y.js +251 -0
- package/es/components/date_picker/date_picker.a11y.js +83 -0
- package/es/components/delay_hide/delay_hide.a11y.js +106 -0
- package/es/components/delay_render/delay_render.a11y.js +106 -0
- package/es/components/empty_prompt/empty_prompt.a11y.js +63 -0
- package/es/components/error_boundary/error_boundary.js +45 -27
- package/es/components/page/page_side_bar/page_side_bar.js +3 -0
- package/es/components/page/page_template.js +1 -15
- package/eui.d.ts +19 -11
- package/i18ntokens.json +4 -4
- package/lib/components/datagrid/data_grid.a11y.js +255 -0
- package/lib/components/date_picker/date_picker.a11y.js +89 -0
- package/lib/components/delay_hide/delay_hide.a11y.js +111 -0
- package/lib/components/delay_render/delay_render.a11y.js +111 -0
- package/lib/components/empty_prompt/empty_prompt.a11y.js +72 -0
- package/lib/components/error_boundary/error_boundary.js +49 -29
- package/lib/components/page/page_side_bar/page_side_bar.js +4 -0
- package/lib/components/page/page_template.js +1 -15
- package/optimize/es/components/datagrid/data_grid.a11y.js +234 -0
- package/optimize/es/components/date_picker/date_picker.a11y.js +73 -0
- package/optimize/es/components/delay_hide/delay_hide.a11y.js +96 -0
- package/optimize/es/components/delay_render/delay_render.a11y.js +96 -0
- package/optimize/es/components/empty_prompt/empty_prompt.a11y.js +63 -0
- package/optimize/es/components/error_boundary/error_boundary.js +37 -26
- package/optimize/es/components/page/page_side_bar/page_side_bar.js +3 -0
- package/optimize/lib/components/datagrid/data_grid.a11y.js +248 -0
- package/optimize/lib/components/date_picker/date_picker.a11y.js +87 -0
- package/optimize/lib/components/delay_hide/delay_hide.a11y.js +111 -0
- package/optimize/lib/components/delay_render/delay_render.a11y.js +111 -0
- package/optimize/lib/components/empty_prompt/empty_prompt.a11y.js +72 -0
- package/optimize/lib/components/error_boundary/error_boundary.js +41 -28
- package/optimize/lib/components/page/page_side_bar/page_side_bar.js +4 -0
- package/package.json +11 -14
- package/src/components/basic_table/_basic_table.scss +1 -4
- package/src/components/button/button_empty/_button_empty.scss +2 -4
- package/src/components/button/button_group/_button_group.scss +1 -1
- package/src/components/button/button_group/_button_group_button.scss +3 -4
- package/src/components/button/button_icon/_button_icon.scss +0 -3
- package/src/components/collapsible_nav/_collapsible_nav.scss +1 -1
- package/src/components/collapsible_nav/collapsible_nav_group/_collapsible_nav_group.scss +1 -1
- package/src/components/color_picker/_color_picker.scss +3 -2
- package/src/components/color_picker/_hue.scss +7 -7
- package/src/components/color_picker/_saturation.scss +1 -1
- package/src/components/color_picker/color_palette_display/_mixins.scss +1 -1
- package/src/components/color_picker/color_stops/_color_stops.scss +2 -3
- package/src/components/combo_box/_combo_box.scss +7 -6
- package/src/components/combo_box/combo_box_input/_combo_box_input.scss +2 -1
- package/src/components/combo_box/combo_box_input/_combo_box_placeholder.scss +1 -1
- package/src/components/combo_box/combo_box_options_list/_combo_box_options_list.scss +2 -3
- package/src/components/control_bar/_variables.scss +0 -1
- package/src/components/datagrid/_data_grid_data_row.scss +4 -5
- package/src/components/datagrid/_mixins.scss +1 -1
- package/src/components/datagrid/body/_data_grid_footer_row.scss +2 -1
- package/src/components/datagrid/body/header/_data_grid_column_resizer.scss +3 -4
- package/src/components/datagrid/body/header/_data_grid_header_row.scss +1 -1
- package/src/components/datagrid/controls/_data_grid_column_sorting.scss +1 -2
- package/src/components/date_picker/_date_picker_range.scss +1 -1
- package/src/components/date_picker/super_date_picker/_super_date_picker.scss +1 -4
- package/src/components/date_picker/super_date_picker/quick_select_popover/_quick_select_popover.scss +1 -1
- package/src/components/drag_and_drop/_draggable.scss +3 -5
- package/src/components/drag_and_drop/_droppable.scss +1 -1
- package/src/components/empty_prompt/_empty_prompt.scss +1 -1
- package/src/components/filter_group/_filter_group.scss +2 -2
- package/src/components/filter_group/_filter_select_item.scss +0 -1
- package/src/components/form/checkbox/_checkbox.scss +5 -3
- package/src/components/form/described_form_group/_described_form_group.scss +0 -1
- package/src/components/form/field_password/_field_password.scss +1 -1
- package/src/components/form/field_search/_field_search.scss +1 -1
- package/src/components/form/file_picker/_file_picker.scss +1 -2
- package/src/components/form/form_control_layout/_form_control_layout.scss +6 -7
- package/src/components/form/form_control_layout/_form_control_layout_delimited.scss +4 -6
- package/src/components/form/form_row/_form_row.scss +3 -0
- package/src/components/form/radio/_radio.scss +5 -3
- package/src/components/form/select/_select.scss +1 -1
- package/src/components/form/switch/_switch.scss +3 -1
- package/src/components/header/_mixins.scss +1 -1
- package/src/components/header/header_section/_header_section_item.scss +4 -4
- package/src/components/header/header_section/_header_section_item_button.scss +0 -1
- package/src/components/key_pad_menu/_key_pad_menu_item.scss +2 -7
- package/src/components/markdown_editor/_markdown_editor_drop_zone.scss +4 -4
- package/src/components/markdown_editor/_markdown_editor_footer.scss +1 -1
- package/src/components/markdown_editor/_markdown_editor_text_area.scss +2 -3
- package/src/components/markdown_editor/_markdown_format.scss +4 -2
- package/src/components/notification/_notification_event.scss +2 -2
- package/src/components/page/page_content/_page_content_body.scss +0 -1
- package/src/components/page/page_content/_page_content_header_section.scss +0 -1
- package/src/components/page/page_side_bar/_page_side_bar.scss +0 -1
- package/src/components/panel/split_panel/_split_panel.scss +2 -2
- package/src/components/resizable_container/_resizable_button.scss +31 -31
- package/src/components/resizable_container/_resizable_collapse_button.scss +9 -9
- package/src/components/selectable/selectable_templates/_selectable_template_sitewide_option.scss +1 -1
- package/src/components/side_nav/_mixins.scss +1 -1
- package/src/components/side_nav/_side_nav.scss +2 -1
- package/src/components/side_nav/_side_nav_item.scss +2 -3
- package/src/components/steps/_steps.scss +2 -1
- package/src/components/suggest/_suggest_input.scss +1 -1
- package/src/components/suggest/_suggest_item.scss +4 -3
- package/src/components/table/_responsive.scss +5 -3
- package/src/components/table/_table.scss +2 -4
- package/src/components/table/mobile/_mobile.scss +0 -2
- package/src/components/tree_view/tree_view.scss +2 -2
- package/src/global_styling/mixins/_form.scss +7 -18
- package/src/global_styling/mixins/_header.scss +2 -2
- package/src/global_styling/mixins/_helpers.scss +1 -2
- package/src/global_styling/mixins/_icons.scss +1 -1
- package/src/global_styling/mixins/_range.scss +4 -8
- package/src/global_styling/mixins/_responsive.scss +3 -8
- package/src/global_styling/mixins/_shadow.scss +5 -9
- package/src/global_styling/mixins/_states.scss +2 -2
- package/src/global_styling/mixins/_typography.scss +16 -19
- package/src/global_styling/variables/_colors_vis.scss +1 -1
- package/src/global_styling/variables/_typography.scss +1 -3
- package/src/themes/amsterdam/_colors_dark.scss +2 -1
- package/src/themes/amsterdam/_colors_light.scss +2 -0
- package/src/themes/amsterdam/global_styling/mixins/_link.scss +1 -1
- package/src/themes/amsterdam/global_styling/mixins/_states.scss +0 -1
- package/src/themes/amsterdam/global_styling/mixins/_typography.scss +1 -2
- package/src/themes/amsterdam/global_styling/react_date_picker/_date_picker_days.scss +0 -1
- package/src/themes/amsterdam/global_styling/react_date_picker/_date_picker_month_year.scss +0 -1
- package/src/themes/amsterdam/global_styling/react_date_picker/_date_picker_times.scss +3 -4
- package/src/themes/amsterdam/global_styling/react_date_picker/_mixins.scss +0 -1
- package/src/themes/amsterdam/global_styling/variables/_typography.scss +1 -2
- package/src/themes/amsterdam/overrides/_color_stops.scss +4 -5
- package/src/themes/amsterdam/overrides/_combo_box.scss +3 -0
- package/src/themes/amsterdam/overrides/_form_control_layout.scss +3 -0
- package/src/themes/amsterdam/overrides/_form_control_layout_delimited.scss +5 -4
- package/src/themes/amsterdam/overrides/_header.scss +2 -2
- package/src/themes/amsterdam/overrides/_hue.scss +6 -6
- package/src/themes/amsterdam/overrides/_key_pad_menu.scss +2 -2
- package/src/themes/amsterdam/overrides/_steps.scss +1 -2
- package/src/themes/legacy/_colors_dark.scss +2 -1
- package/src/themes/legacy/_colors_light.scss +2 -0
- package/src/themes/legacy/reset/_reset.scss +8 -7
- package/test-env/components/datagrid/data_grid.a11y.js +248 -0
- package/test-env/components/date_picker/date_picker.a11y.js +87 -0
- package/test-env/components/delay_hide/delay_hide.a11y.js +111 -0
- package/test-env/components/delay_render/delay_render.a11y.js +111 -0
- package/test-env/components/empty_prompt/empty_prompt.a11y.js +72 -0
- package/test-env/components/error_boundary/error_boundary.js +48 -28
- package/test-env/components/page/page_side_bar/page_side_bar.js +4 -0
- package/test-env/components/page/page_template.js +1 -15
- package/scripts/postinstall.js +0 -9
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
|
|
7
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8
|
+
|
|
9
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
+
|
|
11
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
|
|
13
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
+
|
|
15
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
16
|
+
|
|
17
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
18
|
+
|
|
19
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
+
|
|
21
|
+
/*
|
|
22
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
23
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
24
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
25
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
26
|
+
* Side Public License, v 1.
|
|
27
|
+
*/
|
|
28
|
+
/// <reference types="../../../cypress/support"/>
|
|
29
|
+
import React, { useState } from 'react';
|
|
30
|
+
import { EuiDataGrid } from './index';
|
|
31
|
+
import { faker } from '@faker-js/faker';
|
|
32
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
33
|
+
var columns = [{
|
|
34
|
+
id: 'Name'
|
|
35
|
+
}, {
|
|
36
|
+
id: 'Email',
|
|
37
|
+
cellActions: [function (_ref) {
|
|
38
|
+
var rowIndex = _ref.rowIndex,
|
|
39
|
+
columnId = _ref.columnId,
|
|
40
|
+
Component = _ref.Component;
|
|
41
|
+
var row = ++rowIndex;
|
|
42
|
+
return ___EmotionJSX(Component, {
|
|
43
|
+
onClick: function onClick() {},
|
|
44
|
+
iconType: "heart",
|
|
45
|
+
"aria-label": "Send love to ".concat(row, ", column \"").concat(columnId, "\" ")
|
|
46
|
+
}, "Send love");
|
|
47
|
+
}]
|
|
48
|
+
}, {
|
|
49
|
+
id: 'User ID',
|
|
50
|
+
schema: 'string'
|
|
51
|
+
}, {
|
|
52
|
+
id: 'Account balance'
|
|
53
|
+
}, {
|
|
54
|
+
id: 'Last purchase',
|
|
55
|
+
schema: 'datetime'
|
|
56
|
+
}, {
|
|
57
|
+
id: 'Favorite distro',
|
|
58
|
+
schema: 'favoriteDistro'
|
|
59
|
+
}];
|
|
60
|
+
var storeData = [];
|
|
61
|
+
|
|
62
|
+
for (var i = 1; i < 11; i++) {
|
|
63
|
+
storeData.push({
|
|
64
|
+
Name: "".concat(faker.name.lastName(), ", ").concat(faker.name.firstName(), " ").concat(faker.name.suffix()),
|
|
65
|
+
Email: "".concat(faker.internet.email()),
|
|
66
|
+
'User ID': "".concat(faker.datatype.number({
|
|
67
|
+
min: 1000000,
|
|
68
|
+
max: 9999999
|
|
69
|
+
})),
|
|
70
|
+
'Account balance': faker.finance.amount(),
|
|
71
|
+
'Last purchase': "".concat(faker.date.past()),
|
|
72
|
+
'Favorite distro': i % 2 === 0 ? 'Alma' : 'Debian'
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
var commaSeparateNumbers = function commaSeparateNumbers(numberString) {
|
|
77
|
+
// extract the groups-of-three digits that are right-aligned
|
|
78
|
+
return numberString.replace(/((\d{3})+)$/, function (match) {
|
|
79
|
+
return (// then replace each group of xyz digits with ,xyz
|
|
80
|
+
match.replace(/(\d{3})/g, ',$1')
|
|
81
|
+
);
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
var DataGrid = function DataGrid() {
|
|
86
|
+
var _useState = useState(columns.map(function (_ref2) {
|
|
87
|
+
var id = _ref2.id;
|
|
88
|
+
return id;
|
|
89
|
+
})),
|
|
90
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
91
|
+
visibleColumns = _useState2[0],
|
|
92
|
+
setVisibleColumns = _useState2[1];
|
|
93
|
+
|
|
94
|
+
var _useState3 = useState(storeData),
|
|
95
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
96
|
+
data = _useState4[0],
|
|
97
|
+
setData = _useState4[1];
|
|
98
|
+
|
|
99
|
+
var _useState5 = useState([{
|
|
100
|
+
id: 'custom',
|
|
101
|
+
direction: 'asc'
|
|
102
|
+
}]),
|
|
103
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
104
|
+
sortingColumns = _useState6[0],
|
|
105
|
+
setSortingColumns = _useState6[1];
|
|
106
|
+
|
|
107
|
+
var setSorting = function setSorting(sortingColumns) {
|
|
108
|
+
var sortedData = _toConsumableArray(data).sort(function (a, b) {
|
|
109
|
+
for (var _i2 = 0; _i2 < sortingColumns.length; _i2++) {
|
|
110
|
+
var column = sortingColumns[_i2];
|
|
111
|
+
var aValue = a[column.id];
|
|
112
|
+
var bValue = b[column.id];
|
|
113
|
+
if (aValue < bValue) return column.direction === 'asc' ? -1 : 1;
|
|
114
|
+
if (aValue > bValue) return column.direction === 'asc' ? 1 : -1;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return 0;
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
setData(sortedData);
|
|
121
|
+
setSortingColumns(sortingColumns);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
return ___EmotionJSX(EuiDataGrid, {
|
|
125
|
+
"aria-label": "Data grid schema example",
|
|
126
|
+
columns: columns,
|
|
127
|
+
columnVisibility: {
|
|
128
|
+
visibleColumns: visibleColumns,
|
|
129
|
+
setVisibleColumns: setVisibleColumns
|
|
130
|
+
},
|
|
131
|
+
rowCount: data.length,
|
|
132
|
+
inMemory: {
|
|
133
|
+
level: 'sorting'
|
|
134
|
+
},
|
|
135
|
+
renderCellValue: function renderCellValue(_ref3) {
|
|
136
|
+
var rowIndex = _ref3.rowIndex,
|
|
137
|
+
columnId = _ref3.columnId,
|
|
138
|
+
schema = _ref3.schema;
|
|
139
|
+
var value = data[rowIndex][columnId];
|
|
140
|
+
|
|
141
|
+
if (schema === 'numeric') {
|
|
142
|
+
value = commaSeparateNumbers(value);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return value;
|
|
146
|
+
},
|
|
147
|
+
sorting: {
|
|
148
|
+
columns: sortingColumns,
|
|
149
|
+
onSort: setSorting
|
|
150
|
+
},
|
|
151
|
+
schemaDetectors: [{
|
|
152
|
+
type: 'favoriteDistro',
|
|
153
|
+
textTransform: 'capitalize',
|
|
154
|
+
detector: function detector(value) {
|
|
155
|
+
return value.toLowerCase() === 'alma' || value.toLowerCase() === 'debian' ? 1 : 0;
|
|
156
|
+
},
|
|
157
|
+
comparator: function comparator(a, b, direction) {
|
|
158
|
+
var aValue = a.toLowerCase() === 'alma';
|
|
159
|
+
var bValue = b.toLowerCase() === 'alma';
|
|
160
|
+
if (aValue < bValue) return direction === 'asc' ? 1 : -1;
|
|
161
|
+
if (aValue > bValue) return direction === 'asc' ? -1 : 1;
|
|
162
|
+
return 0;
|
|
163
|
+
},
|
|
164
|
+
sortTextAsc: 'Alma to Debian',
|
|
165
|
+
sortTextDesc: 'Debian to Alma',
|
|
166
|
+
icon: 'starFilled',
|
|
167
|
+
color: '#800080'
|
|
168
|
+
}]
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
beforeEach(function () {
|
|
173
|
+
cy.viewport(1280, 800); // large breakpoint
|
|
174
|
+
|
|
175
|
+
cy.mount(___EmotionJSX("div", {
|
|
176
|
+
style: {
|
|
177
|
+
width: '80%',
|
|
178
|
+
margin: '0 auto'
|
|
179
|
+
}
|
|
180
|
+
}, ___EmotionJSX(DataGrid, null)));
|
|
181
|
+
});
|
|
182
|
+
describe('EuiDataGrid', function () {
|
|
183
|
+
describe('Automated accessibility check', function () {
|
|
184
|
+
it('has zero violations on first render', function () {
|
|
185
|
+
cy.checkAxe();
|
|
186
|
+
});
|
|
187
|
+
it('has zero violations when the columns reorder menu is open', function () {
|
|
188
|
+
cy.get('button[data-test-subj="dataGridColumnSelectorButton"]').realClick();
|
|
189
|
+
cy.checkAxe();
|
|
190
|
+
});
|
|
191
|
+
it('has zero violations when the hide all columns button is clicked', function () {
|
|
192
|
+
cy.get('button[data-test-subj="dataGridColumnSelectorButton"]').realClick();
|
|
193
|
+
cy.get('button[data-test-subj="dataGridColumnSelectorHideAllButton"]').realClick(); // TODO: Log this issue and remove the skipFailures boolean when fixed
|
|
194
|
+
|
|
195
|
+
cy.checkAxe({
|
|
196
|
+
skipFailures: true
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
it('has zero violations when the columns reorder searchbox returns multiple results', function () {
|
|
200
|
+
cy.get('button[data-test-subj="dataGridColumnSelectorButton"]').realClick();
|
|
201
|
+
cy.get('input[data-test-subj="dataGridColumnSelectorSearch"]').type('a');
|
|
202
|
+
cy.get('div.euiSwitch--compressed').should(function ($s) {
|
|
203
|
+
expect($s).to.have.length(5);
|
|
204
|
+
});
|
|
205
|
+
cy.checkAxe();
|
|
206
|
+
});
|
|
207
|
+
it('has zero violations when the columns reorder searchbox returns 1 result', function () {
|
|
208
|
+
cy.get('button[data-test-subj="dataGridColumnSelectorButton"]').realClick();
|
|
209
|
+
cy.get('input[data-test-subj="dataGridColumnSelectorSearch"]').type('favorite');
|
|
210
|
+
cy.get('div.euiSwitch--compressed').should(function ($s) {
|
|
211
|
+
expect($s).to.have.length(1);
|
|
212
|
+
});
|
|
213
|
+
cy.checkAxe();
|
|
214
|
+
});
|
|
215
|
+
it('has zero violations when the columns reorder searchbox returns 0 results', function () {
|
|
216
|
+
cy.get('button[data-test-subj="dataGridColumnSelectorButton"]').realClick();
|
|
217
|
+
cy.get('input[data-test-subj="dataGridColumnSelectorSearch"]').type('x');
|
|
218
|
+
cy.get('div.euiSwitch--compressed').should(function ($s) {
|
|
219
|
+
expect($s).to.have.length(0);
|
|
220
|
+
});
|
|
221
|
+
cy.checkAxe();
|
|
222
|
+
});
|
|
223
|
+
it('has zero violations when the keyboard shortcut menu is open', function () {
|
|
224
|
+
cy.get('button[data-test-subj="dataGridKeyboardShortcutsButton"]').realClick();
|
|
225
|
+
cy.checkAxe();
|
|
226
|
+
});
|
|
227
|
+
it('has zero violations when the grid display menu is open', function () {
|
|
228
|
+
cy.get('button[data-test-subj="dataGridDisplaySelectorButton"]').realClick();
|
|
229
|
+
cy.checkAxe();
|
|
230
|
+
});
|
|
231
|
+
it('has zero violations when the column actions menu is open', function () {
|
|
232
|
+
cy.get('button.euiDataGridHeaderCell__button').first().realClick();
|
|
233
|
+
cy.checkAxe();
|
|
234
|
+
});
|
|
235
|
+
it('has zero violations when a cell expansion popover is open', function () {
|
|
236
|
+
cy.get('div[data-gridcell-visible-row-index="0"][data-gridcell-column-index="1"]').realClick();
|
|
237
|
+
cy.get('div[data-gridcell-visible-row-index="0"][data-gridcell-column-index="1"]').find('button.euiButtonIcon').last().realClick();
|
|
238
|
+
cy.checkAxe();
|
|
239
|
+
});
|
|
240
|
+
it('has zero violations when the Favorite Distro column has been sorted', function () {
|
|
241
|
+
cy.get('button.euiDataGridHeaderCell__button').last().realClick();
|
|
242
|
+
cy.get('button.euiListGroupItem__button').contains('Sort Alma to Debian').should('exist').realClick();
|
|
243
|
+
cy.checkAxe();
|
|
244
|
+
});
|
|
245
|
+
it('has zero violations when fullscreen is open', function () {
|
|
246
|
+
cy.get('button[data-test-subj="dataGridFullScreenButton"]').realClick();
|
|
247
|
+
cy.get('div.euiDataGrid--fullScreen').should('exist');
|
|
248
|
+
cy.checkAxe();
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
+
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
15
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
16
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
17
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
18
|
+
* Side Public License, v 1.
|
|
19
|
+
*/
|
|
20
|
+
/// <reference types="../../../cypress/support"/>
|
|
21
|
+
import React, { useState } from 'react';
|
|
22
|
+
import moment from 'moment';
|
|
23
|
+
import { EuiDatePicker } from './date_picker';
|
|
24
|
+
import { EuiFormRow } from '../form';
|
|
25
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
26
|
+
|
|
27
|
+
var DatePicker = function DatePicker() {
|
|
28
|
+
var _useState = useState(moment()),
|
|
29
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
30
|
+
startDate = _useState2[0],
|
|
31
|
+
setStartDate = _useState2[1];
|
|
32
|
+
|
|
33
|
+
var handleChange = function handleChange(date) {
|
|
34
|
+
setStartDate(date);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return ___EmotionJSX(EuiFormRow, {
|
|
38
|
+
label: "Select a date"
|
|
39
|
+
}, ___EmotionJSX(EuiDatePicker, {
|
|
40
|
+
selected: startDate,
|
|
41
|
+
onChange: handleChange
|
|
42
|
+
}));
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
beforeEach(function () {
|
|
46
|
+
cy.realMount(___EmotionJSX(DatePicker, null));
|
|
47
|
+
cy.get('input.euiDatePicker').should('exist');
|
|
48
|
+
});
|
|
49
|
+
describe('EuiDatePicker', function () {
|
|
50
|
+
describe('Automated accessibility check', function () {
|
|
51
|
+
it('has zero violations on first render', function () {
|
|
52
|
+
cy.checkAxe();
|
|
53
|
+
});
|
|
54
|
+
it('has zero violations when the calendar widget is expanded', function () {
|
|
55
|
+
cy.get('input.euiDatePicker').realClick();
|
|
56
|
+
cy.get('div.react-datepicker').should('exist');
|
|
57
|
+
cy.checkAxe();
|
|
58
|
+
});
|
|
59
|
+
it('has zero violations after picking a date with arrow keys', function () {
|
|
60
|
+
cy.realPress('Tab');
|
|
61
|
+
cy.get('div.react-datepicker').should('exist');
|
|
62
|
+
cy.repeatRealPress('ArrowDown');
|
|
63
|
+
cy.realPress('ArrowRight');
|
|
64
|
+
cy.realPress('Enter');
|
|
65
|
+
cy.get('div.react-datepicker').should('not.exist');
|
|
66
|
+
cy.checkAxe();
|
|
67
|
+
});
|
|
68
|
+
it('has zero violations after picking a date with dropdown menus', function () {
|
|
69
|
+
cy.realPress('Tab');
|
|
70
|
+
cy.get('div.react-datepicker').should('exist');
|
|
71
|
+
cy.repeatRealPress('Tab', 4);
|
|
72
|
+
cy.get('div.react-datepicker__month-read-view').should('have.focus');
|
|
73
|
+
cy.realPress('Space');
|
|
74
|
+
cy.repeatRealPress('ArrowDown');
|
|
75
|
+
cy.realPress('Enter');
|
|
76
|
+
cy.realPress('Tab');
|
|
77
|
+
cy.realPress('Space');
|
|
78
|
+
cy.repeatRealPress('ArrowDown');
|
|
79
|
+
cy.realPress('Enter');
|
|
80
|
+
cy.checkAxe();
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
});
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
+
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
15
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
16
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
17
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
18
|
+
* Side Public License, v 1.
|
|
19
|
+
*/
|
|
20
|
+
/// <reference types="../../../cypress/support"/>
|
|
21
|
+
import React, { useState } from 'react';
|
|
22
|
+
import { EuiDelayHide } from './delay_hide';
|
|
23
|
+
import { EuiCheckbox, EuiFieldNumber, EuiFormRow } from '../form';
|
|
24
|
+
import { EuiFlexItem } from '../flex';
|
|
25
|
+
import { EuiLoadingSpinner } from '../loading';
|
|
26
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
27
|
+
|
|
28
|
+
var DelayHide = function DelayHide() {
|
|
29
|
+
var _useState = useState(1000),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
minimumDuration = _useState2[0],
|
|
32
|
+
setDuration = _useState2[1];
|
|
33
|
+
|
|
34
|
+
var _useState3 = useState(false),
|
|
35
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
36
|
+
hide = _useState4[0],
|
|
37
|
+
setHide = _useState4[1];
|
|
38
|
+
|
|
39
|
+
var onChangeMinimumDuration = function onChangeMinimumDuration(event) {
|
|
40
|
+
setDuration(parseInt(event.target.value, 10));
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var onChangeHide = function onChangeHide(event) {
|
|
44
|
+
setHide(event.target.checked);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiFlexItem, null, ___EmotionJSX(EuiFormRow, null, ___EmotionJSX(EuiCheckbox, {
|
|
48
|
+
id: "dummy-id",
|
|
49
|
+
checked: hide,
|
|
50
|
+
onChange: onChangeHide,
|
|
51
|
+
label: "Hide child"
|
|
52
|
+
})), ___EmotionJSX(EuiFormRow, {
|
|
53
|
+
label: "Minimum duration"
|
|
54
|
+
}, ___EmotionJSX(EuiFieldNumber, {
|
|
55
|
+
value: minimumDuration,
|
|
56
|
+
onChange: onChangeMinimumDuration
|
|
57
|
+
})), ___EmotionJSX(EuiFormRow, {
|
|
58
|
+
label: "Child to render"
|
|
59
|
+
}, ___EmotionJSX(EuiDelayHide, {
|
|
60
|
+
hide: hide,
|
|
61
|
+
minimumDuration: minimumDuration,
|
|
62
|
+
render: function render() {
|
|
63
|
+
return ___EmotionJSX(EuiLoadingSpinner, {
|
|
64
|
+
size: "m"
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}))));
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
beforeEach(function () {
|
|
71
|
+
cy.realMount(___EmotionJSX(DelayHide, null));
|
|
72
|
+
});
|
|
73
|
+
describe('EuiHideRender', function () {
|
|
74
|
+
describe('Automated accessibility check', function () {
|
|
75
|
+
it('has zero violations on first render', function () {
|
|
76
|
+
cy.checkAxe();
|
|
77
|
+
});
|
|
78
|
+
it('has zero violations when the hide child input is checked', function () {
|
|
79
|
+
cy.get('input.euiCheckbox__input').realClick();
|
|
80
|
+
cy.get('div.euiFormRow__fieldWrapper').last().find('span[role="progressbar"]', {
|
|
81
|
+
timeout: 5000
|
|
82
|
+
}).should('not.exist');
|
|
83
|
+
cy.checkAxe();
|
|
84
|
+
});
|
|
85
|
+
it('has zero violations when the hide child input is pressed', function () {
|
|
86
|
+
cy.realPress('Tab');
|
|
87
|
+
cy.get('input.euiCheckbox__input').should('have.focus');
|
|
88
|
+
cy.realPress('Space');
|
|
89
|
+
cy.get('div.euiFormRow__fieldWrapper').last().find('span[role="progressbar"]', {
|
|
90
|
+
timeout: 5000
|
|
91
|
+
}).should('not.exist');
|
|
92
|
+
cy.checkAxe();
|
|
93
|
+
});
|
|
94
|
+
it('has zero violations when the hide child input is toggled', function () {
|
|
95
|
+
cy.realPress('Tab');
|
|
96
|
+
cy.get('input.euiCheckbox__input').should('have.focus');
|
|
97
|
+
cy.realPress('Space');
|
|
98
|
+
cy.get('div.euiFormRow__fieldWrapper').last().find('span[role="progressbar"]').should('not.exist');
|
|
99
|
+
cy.realPress('Space');
|
|
100
|
+
cy.get('div.euiFormRow__fieldWrapper').last().find('span[role="progressbar"]', {
|
|
101
|
+
timeout: 5000
|
|
102
|
+
}).should('exist');
|
|
103
|
+
cy.checkAxe();
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
});
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
+
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
15
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
16
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
17
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
18
|
+
* Side Public License, v 1.
|
|
19
|
+
*/
|
|
20
|
+
/// <reference types="../../../cypress/support"/>
|
|
21
|
+
import React, { useState } from 'react';
|
|
22
|
+
import { EuiDelayRender } from './delay_render';
|
|
23
|
+
import { EuiCheckbox, EuiFieldNumber, EuiFormRow } from '../form';
|
|
24
|
+
import { EuiFlexItem } from '../flex';
|
|
25
|
+
import { EuiLoadingSpinner } from '../loading';
|
|
26
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
27
|
+
|
|
28
|
+
var DelayRender = function DelayRender() {
|
|
29
|
+
var _useState = useState(1000),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
minimumDelay = _useState2[0],
|
|
32
|
+
setDelay = _useState2[1];
|
|
33
|
+
|
|
34
|
+
var _useState3 = useState(false),
|
|
35
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
36
|
+
render = _useState4[0],
|
|
37
|
+
setRender = _useState4[1];
|
|
38
|
+
|
|
39
|
+
var onChangeMinimumDelay = function onChangeMinimumDelay(event) {
|
|
40
|
+
setDelay(parseInt(event.target.value, 10));
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var onChangeHide = function onChangeHide(event) {
|
|
44
|
+
setRender(event.target.checked);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var status = render ? 'showing' : 'hidden';
|
|
48
|
+
var label = "Child (".concat(status, ")");
|
|
49
|
+
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiFlexItem, null, ___EmotionJSX(EuiFormRow, null, ___EmotionJSX(EuiCheckbox, {
|
|
50
|
+
id: "dummy-id",
|
|
51
|
+
checked: render,
|
|
52
|
+
onChange: onChangeHide,
|
|
53
|
+
label: "Show child"
|
|
54
|
+
})), ___EmotionJSX(EuiFormRow, {
|
|
55
|
+
label: "Minimum delay"
|
|
56
|
+
}, ___EmotionJSX(EuiFieldNumber, {
|
|
57
|
+
value: minimumDelay,
|
|
58
|
+
onChange: onChangeMinimumDelay
|
|
59
|
+
})), ___EmotionJSX(EuiFormRow, {
|
|
60
|
+
label: label
|
|
61
|
+
}, render ? ___EmotionJSX(EuiDelayRender, {
|
|
62
|
+
delay: minimumDelay
|
|
63
|
+
}, ___EmotionJSX(EuiLoadingSpinner, {
|
|
64
|
+
size: "m"
|
|
65
|
+
})) : ___EmotionJSX(React.Fragment, null))));
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
beforeEach(function () {
|
|
69
|
+
cy.realMount(___EmotionJSX(DelayRender, null));
|
|
70
|
+
});
|
|
71
|
+
describe('EuiDelayRender', function () {
|
|
72
|
+
describe('Automated accessibility check', function () {
|
|
73
|
+
it('has zero violations on first render', function () {
|
|
74
|
+
cy.checkAxe();
|
|
75
|
+
});
|
|
76
|
+
it('has zero violations when the show child input is checked', function () {
|
|
77
|
+
cy.get('input.euiCheckbox__input').realClick();
|
|
78
|
+
cy.get('div.euiFormRow__fieldWrapper').last().find('span[role="progressbar"]', {
|
|
79
|
+
timeout: 5000
|
|
80
|
+
}).should('exist');
|
|
81
|
+
cy.checkAxe();
|
|
82
|
+
});
|
|
83
|
+
it('has zero violations when the show child input is pressed', function () {
|
|
84
|
+
cy.realPress('Tab');
|
|
85
|
+
cy.get('input.euiCheckbox__input').should('have.focus');
|
|
86
|
+
cy.realPress('Space');
|
|
87
|
+
cy.get('div.euiFormRow__fieldWrapper').last().find('span[role="progressbar"]', {
|
|
88
|
+
timeout: 5000
|
|
89
|
+
}).should('exist');
|
|
90
|
+
cy.checkAxe();
|
|
91
|
+
});
|
|
92
|
+
it('has zero violations when the show child input is toggled', function () {
|
|
93
|
+
cy.realPress('Tab');
|
|
94
|
+
cy.get('input.euiCheckbox__input').should('have.focus');
|
|
95
|
+
cy.realPress('Space');
|
|
96
|
+
cy.get('div.euiFormRow__fieldWrapper').last().find('span[role="progressbar"]', {
|
|
97
|
+
timeout: 5000
|
|
98
|
+
});
|
|
99
|
+
cy.realPress('Space');
|
|
100
|
+
cy.get('div.euiFormRow__fieldWrapper').last().find('span[role="progressbar"]', {
|
|
101
|
+
timeout: 5000
|
|
102
|
+
}).should('not.exist');
|
|
103
|
+
cy.checkAxe();
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
/// <reference types="../../../cypress/support"/>
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { EuiButton } from '../button';
|
|
11
|
+
import { EuiEmptyPrompt } from './empty_prompt';
|
|
12
|
+
import { EuiLink } from '../link';
|
|
13
|
+
import { EuiTitle } from '../title';
|
|
14
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
15
|
+
|
|
16
|
+
var EmptyPrompt = function EmptyPrompt(_ref) {
|
|
17
|
+
var addCaseSpy = _ref.addCaseSpy,
|
|
18
|
+
addLinkSpy = _ref.addLinkSpy;
|
|
19
|
+
return ___EmotionJSX(EuiEmptyPrompt, {
|
|
20
|
+
iconType: "logoSecurity",
|
|
21
|
+
title: ___EmotionJSX("h2", null, "Start adding cases"),
|
|
22
|
+
body: ___EmotionJSX("p", null, "Add a new case or change your filter settings."),
|
|
23
|
+
actions: ___EmotionJSX(EuiButton, {
|
|
24
|
+
color: "primary",
|
|
25
|
+
onClick: addCaseSpy,
|
|
26
|
+
fill: true
|
|
27
|
+
}, "Add a case"),
|
|
28
|
+
footer: ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiTitle, {
|
|
29
|
+
size: "xxs"
|
|
30
|
+
}, ___EmotionJSX("h3", null, "Want to learn more?")), ___EmotionJSX(EuiLink, {
|
|
31
|
+
href: "#",
|
|
32
|
+
onClick: addLinkSpy
|
|
33
|
+
}, "Read the docs"))
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
beforeEach(function () {
|
|
38
|
+
var addCaseSpy = cy.spy().as('addCaseSpy');
|
|
39
|
+
var addLinkSpy = cy.spy().as('addLinkSpy');
|
|
40
|
+
cy.viewport(1024, 768); // medium breakpoint
|
|
41
|
+
|
|
42
|
+
cy.realMount(___EmotionJSX(EmptyPrompt, {
|
|
43
|
+
addCaseSpy: addCaseSpy,
|
|
44
|
+
addLinkSpy: addLinkSpy
|
|
45
|
+
}));
|
|
46
|
+
});
|
|
47
|
+
describe('EuiEmptyPrompt', function () {
|
|
48
|
+
describe('Automated accessibility check', function () {
|
|
49
|
+
it('has zero violations on first render', function () {
|
|
50
|
+
cy.checkAxe();
|
|
51
|
+
});
|
|
52
|
+
it('has zero violations after clicking Add a case button', function () {
|
|
53
|
+
cy.get('button.euiButton').contains('Add a case').realClick();
|
|
54
|
+
cy.get('@addCaseSpy').should('have.been.called');
|
|
55
|
+
cy.checkAxe();
|
|
56
|
+
});
|
|
57
|
+
it('has zero violations after clicking Read the docs link', function () {
|
|
58
|
+
cy.get('a.euiLink').contains('Read the docs').realClick();
|
|
59
|
+
cy.get('@addLinkSpy').should('have.been.called');
|
|
60
|
+
cy.checkAxe();
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
});
|