@elastic/eui 71.0.0 → 72.0.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 +7747 -5854
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +7737 -5844
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/datagrid/data_grid.a11y.js +251 -0
- package/es/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/es/components/date_picker/date_picker.a11y.js +83 -0
- package/es/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/es/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/es/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +160 -173
- package/es/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.js +16 -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.a11y.js +67 -0
- package/es/components/error_boundary/error_boundary.js +45 -27
- package/es/components/expression/expression.a11y.js +254 -0
- package/es/components/filter_group/filter_group.a11y.js +281 -0
- package/es/components/focus_trap/focus_trap.a11y.js +131 -0
- package/es/components/form/file_picker/file_picker.js +1 -0
- package/es/components/header/header.a11y.js +374 -0
- package/es/components/icon/icon_ML.a11y.js +33 -0
- package/es/components/icon/icon_apps.a11y.js +33 -0
- package/es/components/icon/icon_editor.a11y.js +33 -0
- package/es/components/icon/icon_elastic.a11y.js +33 -0
- package/es/components/icon/icon_glyphs.a11y.js +33 -0
- package/es/components/icon/icon_tokens.a11y.js +33 -0
- package/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +1 -1
- package/es/components/page/page_side_bar/page_side_bar.js +3 -0
- package/es/components/page/page_template.js +1 -15
- package/es/components/selectable/selectable.js +4 -3
- package/es/components/selectable/selectable_list/selectable_list.js +17 -5
- package/es/components/tabs/tab.js +7 -17
- package/es/components/tabs/tabbed_content/tabbed_content.js +0 -16
- package/es/components/tabs/tabs.js +7 -11
- package/es/components/tabs/tabs_context.js +13 -0
- package/eui.d.ts +60 -43
- package/i18ntokens.json +34 -18
- package/lib/components/datagrid/data_grid.a11y.js +255 -0
- package/lib/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/lib/components/date_picker/date_picker.a11y.js +89 -0
- package/lib/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +155 -168
- package/lib/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +16 -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.a11y.js +75 -0
- package/lib/components/error_boundary/error_boundary.js +49 -29
- package/lib/components/expression/expression.a11y.js +262 -0
- package/lib/components/filter_group/filter_group.a11y.js +287 -0
- package/lib/components/focus_trap/focus_trap.a11y.js +140 -0
- package/lib/components/form/file_picker/file_picker.js +1 -0
- package/lib/components/header/header.a11y.js +385 -0
- package/lib/components/icon/icon_ML.a11y.js +40 -0
- package/lib/components/icon/icon_apps.a11y.js +40 -0
- package/lib/components/icon/icon_editor.a11y.js +40 -0
- package/lib/components/icon/icon_elastic.a11y.js +40 -0
- package/lib/components/icon/icon_glyphs.a11y.js +40 -0
- package/lib/components/icon/icon_tokens.a11y.js +40 -0
- package/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -2
- package/lib/components/page/page_side_bar/page_side_bar.js +4 -0
- package/lib/components/page/page_template.js +1 -15
- package/lib/components/selectable/selectable.js +4 -3
- package/lib/components/selectable/selectable_list/selectable_list.js +17 -5
- package/lib/components/tabs/tab.js +14 -17
- package/lib/components/tabs/tabbed_content/tabbed_content.js +0 -16
- package/lib/components/tabs/tabs.js +8 -14
- package/lib/components/tabs/tabs_context.js +23 -0
- package/optimize/es/components/datagrid/data_grid.a11y.js +234 -0
- package/optimize/es/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/optimize/es/components/date_picker/date_picker.a11y.js +73 -0
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +145 -169
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.js +2 -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.a11y.js +67 -0
- package/optimize/es/components/error_boundary/error_boundary.js +37 -26
- package/optimize/es/components/expression/expression.a11y.js +243 -0
- package/optimize/es/components/filter_group/filter_group.a11y.js +271 -0
- package/optimize/es/components/focus_trap/focus_trap.a11y.js +120 -0
- package/optimize/es/components/form/file_picker/file_picker.js +1 -0
- package/optimize/es/components/header/header.a11y.js +364 -0
- package/optimize/es/components/icon/icon_ML.a11y.js +33 -0
- package/optimize/es/components/icon/icon_apps.a11y.js +33 -0
- package/optimize/es/components/icon/icon_editor.a11y.js +33 -0
- package/optimize/es/components/icon/icon_elastic.a11y.js +33 -0
- package/optimize/es/components/icon/icon_glyphs.a11y.js +33 -0
- package/optimize/es/components/icon/icon_tokens.a11y.js +33 -0
- package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +1 -1
- package/optimize/es/components/page/page_side_bar/page_side_bar.js +3 -0
- package/optimize/es/components/selectable/selectable.js +2 -2
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +15 -4
- package/optimize/es/components/tabs/tab.js +7 -5
- package/optimize/es/components/tabs/tabs.js +7 -11
- package/optimize/es/components/tabs/tabs_context.js +13 -0
- package/optimize/lib/components/datagrid/data_grid.a11y.js +248 -0
- package/optimize/lib/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/optimize/lib/components/date_picker/date_picker.a11y.js +87 -0
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +146 -167
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.js +2 -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.a11y.js +75 -0
- package/optimize/lib/components/error_boundary/error_boundary.js +41 -28
- package/optimize/lib/components/expression/expression.a11y.js +254 -0
- package/optimize/lib/components/filter_group/filter_group.a11y.js +287 -0
- package/optimize/lib/components/focus_trap/focus_trap.a11y.js +140 -0
- package/optimize/lib/components/form/file_picker/file_picker.js +1 -0
- package/optimize/lib/components/header/header.a11y.js +385 -0
- package/optimize/lib/components/icon/icon_ML.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_apps.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_editor.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_elastic.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_glyphs.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_tokens.a11y.js +40 -0
- package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -2
- package/optimize/lib/components/page/page_side_bar/page_side_bar.js +4 -0
- package/optimize/lib/components/selectable/selectable.js +2 -2
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +15 -4
- package/optimize/lib/components/tabs/tab.js +15 -5
- package/optimize/lib/components/tabs/tabs.js +8 -14
- package/optimize/lib/components/tabs/tabs_context.js +23 -0
- package/package.json +14 -19
- 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 +15 -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 +15 -16
- 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/auto_refresh/refresh_interval.js +3 -1
- package/test-env/components/date_picker/date_picker.a11y.js +87 -0
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +153 -166
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +16 -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.a11y.js +75 -0
- package/test-env/components/error_boundary/error_boundary.js +48 -28
- package/test-env/components/expression/expression.a11y.js +254 -0
- package/test-env/components/filter_group/filter_group.a11y.js +287 -0
- package/test-env/components/focus_trap/focus_trap.a11y.js +140 -0
- package/test-env/components/form/file_picker/file_picker.js +1 -0
- package/test-env/components/header/header.a11y.js +385 -0
- package/test-env/components/icon/icon_ML.a11y.js +40 -0
- package/test-env/components/icon/icon_apps.a11y.js +40 -0
- package/test-env/components/icon/icon_editor.a11y.js +40 -0
- package/test-env/components/icon/icon_elastic.a11y.js +40 -0
- package/test-env/components/icon/icon_glyphs.a11y.js +40 -0
- package/test-env/components/icon/icon_tokens.a11y.js +40 -0
- package/test-env/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -2
- 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/test-env/components/selectable/selectable.js +4 -3
- package/test-env/components/selectable/selectable_list/selectable_list.js +17 -5
- package/test-env/components/tabs/tab.js +15 -17
- package/test-env/components/tabs/tabbed_content/tabbed_content.js +0 -16
- package/test-env/components/tabs/tabs.js +8 -14
- package/test-env/components/tabs/tabs_context.js +23 -0
- package/scripts/postinstall.js +0 -9
|
@@ -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
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
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 { EuiErrorBoundary } from './error_boundary';
|
|
12
|
+
import { EuiSpacer } from '../spacer';
|
|
13
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
14
|
+
|
|
15
|
+
var handleFocus = function handleFocus() {
|
|
16
|
+
var target = document.querySelector('pre.euiCodeBlock__pre');
|
|
17
|
+
target.focus();
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
describe('EuiErrorBoundary', function () {
|
|
21
|
+
describe('Automated accessibility check when an error is thrown', function () {
|
|
22
|
+
var BadComponent = function BadComponent() {
|
|
23
|
+
throw new Error('Throw the error.');
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
beforeEach(function () {
|
|
27
|
+
cy.on('uncaught:exception', function (err) {
|
|
28
|
+
if (err.message.includes('Throw the error')) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
cy.viewport(1024, 768); // medium breakpoint
|
|
33
|
+
|
|
34
|
+
cy.realMount(___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiButton, {
|
|
35
|
+
color: "primary",
|
|
36
|
+
onClick: handleFocus,
|
|
37
|
+
"data-test-subj": "cy-error-boundary-button"
|
|
38
|
+
}, "Press to focus"), ___EmotionJSX(EuiSpacer, null), ___EmotionJSX(EuiErrorBoundary, null, ___EmotionJSX(BadComponent, null))));
|
|
39
|
+
});
|
|
40
|
+
it('has zero violations on first render', function () {
|
|
41
|
+
cy.checkAxe();
|
|
42
|
+
});
|
|
43
|
+
it('has zero violations and accepts focus when the button is pressed', function () {
|
|
44
|
+
cy.realPress('Tab');
|
|
45
|
+
cy.realPress('Enter');
|
|
46
|
+
cy.get('pre.euiCodeBlock__pre').should('have.focus');
|
|
47
|
+
cy.checkAxe();
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
describe('Automated accessibility check when no error is thrown', function () {
|
|
51
|
+
var GoodComponent = function GoodComponent() {
|
|
52
|
+
return ___EmotionJSX("div", {
|
|
53
|
+
"data-test-subj": "cy-good-component"
|
|
54
|
+
}, "This is a properly rendered component.");
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
beforeEach(function () {
|
|
58
|
+
cy.viewport(1024, 768); // medium breakpoint
|
|
59
|
+
|
|
60
|
+
cy.realMount(___EmotionJSX(EuiErrorBoundary, null, ___EmotionJSX(GoodComponent, null)));
|
|
61
|
+
});
|
|
62
|
+
it('has zero violations when no violations are thrown', function () {
|
|
63
|
+
cy.get('div[data-test-subj="cy-good-component"]').should('exist');
|
|
64
|
+
cy.checkAxe();
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
2
|
|
|
3
|
-
var _excluded = ["
|
|
3
|
+
var _excluded = ["children"],
|
|
4
|
+
_excluded2 = ["errorMessage", "className", "data-test-subj"];
|
|
4
5
|
|
|
5
6
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
6
7
|
|
|
@@ -41,18 +42,18 @@ import classNames from 'classnames';
|
|
|
41
42
|
import { EuiTitle } from '../title';
|
|
42
43
|
import { EuiCodeBlock } from '../code';
|
|
43
44
|
import { EuiI18n } from '../i18n';
|
|
44
|
-
import {
|
|
45
|
+
import { useEuiTheme } from '../../services';
|
|
45
46
|
import { euiErrorBoundaryStyles } from './error_boundary.styles';
|
|
46
47
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
47
|
-
export var
|
|
48
|
-
_inherits(
|
|
48
|
+
export var EuiErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
49
|
+
_inherits(EuiErrorBoundary, _Component);
|
|
49
50
|
|
|
50
|
-
var _super = _createSuper(
|
|
51
|
+
var _super = _createSuper(EuiErrorBoundary);
|
|
51
52
|
|
|
52
|
-
function
|
|
53
|
+
function EuiErrorBoundary(props) {
|
|
53
54
|
var _this;
|
|
54
55
|
|
|
55
|
-
_classCallCheck(this,
|
|
56
|
+
_classCallCheck(this, EuiErrorBoundary);
|
|
56
57
|
|
|
57
58
|
_this = _super.call(this, props);
|
|
58
59
|
var errorState = {
|
|
@@ -63,7 +64,7 @@ export var _EuiErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
|
63
64
|
return _this;
|
|
64
65
|
}
|
|
65
66
|
|
|
66
|
-
_createClass(
|
|
67
|
+
_createClass(EuiErrorBoundary, [{
|
|
67
68
|
key: "componentDidCatch",
|
|
68
69
|
value: function componentDidCatch(_ref) {
|
|
69
70
|
var message = _ref.message,
|
|
@@ -83,36 +84,28 @@ export var _EuiErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
|
83
84
|
key: "render",
|
|
84
85
|
value: function render() {
|
|
85
86
|
var _this$props = this.props,
|
|
86
|
-
className = _this$props.className,
|
|
87
87
|
children = _this$props.children,
|
|
88
|
-
_dataTestSubj = _this$props['data-test-subj'],
|
|
89
|
-
theme = _this$props.theme,
|
|
90
88
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
91
89
|
|
|
92
|
-
var dataTestSubj = classNames('euiErrorBoundary', _dataTestSubj);
|
|
93
|
-
var styles = euiErrorBoundaryStyles(theme);
|
|
94
|
-
|
|
95
90
|
if (this.state.hasError) {
|
|
96
91
|
// You can render any custom fallback UI
|
|
97
|
-
return ___EmotionJSX(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"data-test-subj": dataTestSubj
|
|
101
|
-
}, rest), ___EmotionJSX(EuiCodeBlock, null, ___EmotionJSX(EuiTitle, {
|
|
102
|
-
size: "xs"
|
|
103
|
-
}, ___EmotionJSX("p", null, ___EmotionJSX(EuiI18n, {
|
|
104
|
-
token: "euiErrorBoundary.error",
|
|
105
|
-
default: "Error"
|
|
106
|
-
}))), this.state.error));
|
|
92
|
+
return ___EmotionJSX(EuiErrorMessage, _extends({}, rest, {
|
|
93
|
+
errorMessage: this.state.error
|
|
94
|
+
}));
|
|
107
95
|
}
|
|
108
96
|
|
|
109
97
|
return children;
|
|
110
98
|
}
|
|
111
99
|
}]);
|
|
112
100
|
|
|
113
|
-
return
|
|
101
|
+
return EuiErrorBoundary;
|
|
114
102
|
}(Component);
|
|
115
|
-
|
|
103
|
+
/**
|
|
104
|
+
* Split out into a separate styling-only component for easier use of hooks,
|
|
105
|
+
* and also for internal re-use by EUI's docs/playgrounds
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
EuiErrorBoundary.propTypes = {
|
|
116
109
|
className: PropTypes.string,
|
|
117
110
|
"aria-label": PropTypes.string,
|
|
118
111
|
"data-test-subj": PropTypes.string,
|
|
@@ -123,4 +116,29 @@ _EuiErrorBoundary.propTypes = {
|
|
|
123
116
|
*/
|
|
124
117
|
children: PropTypes.node.isRequired
|
|
125
118
|
};
|
|
126
|
-
export var
|
|
119
|
+
export var EuiErrorMessage = function EuiErrorMessage(_ref2) {
|
|
120
|
+
var errorMessage = _ref2.errorMessage,
|
|
121
|
+
className = _ref2.className,
|
|
122
|
+
dataTestSubj = _ref2['data-test-subj'],
|
|
123
|
+
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
124
|
+
|
|
125
|
+
var euiTheme = useEuiTheme();
|
|
126
|
+
var styles = euiErrorBoundaryStyles(euiTheme);
|
|
127
|
+
return ___EmotionJSX("div", _extends({
|
|
128
|
+
css: styles.euiErrorBoundary,
|
|
129
|
+
className: classNames('euiErrorBoundary', className),
|
|
130
|
+
"data-test-subj": classNames('euiErrorBoundary', dataTestSubj)
|
|
131
|
+
}, rest), ___EmotionJSX(EuiCodeBlock, null, ___EmotionJSX(EuiTitle, {
|
|
132
|
+
size: "xs"
|
|
133
|
+
}, ___EmotionJSX("p", null, ___EmotionJSX(EuiI18n, {
|
|
134
|
+
token: "euiErrorBoundary.error",
|
|
135
|
+
default: "Error"
|
|
136
|
+
}))), errorMessage));
|
|
137
|
+
};
|
|
138
|
+
EuiErrorMessage.propTypes = {
|
|
139
|
+
className: PropTypes.string,
|
|
140
|
+
"aria-label": PropTypes.string,
|
|
141
|
+
"data-test-subj": PropTypes.string,
|
|
142
|
+
css: PropTypes.any,
|
|
143
|
+
errorMessage: PropTypes.string
|
|
144
|
+
};
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
+
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
|
|
9
|
+
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."); }
|
|
10
|
+
|
|
11
|
+
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); }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
+
|
|
19
|
+
/*
|
|
20
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
21
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
22
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
23
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
24
|
+
* Side Public License, v 1.
|
|
25
|
+
*/
|
|
26
|
+
/// <reference types="../../../cypress/support"/>
|
|
27
|
+
import React, { useState } from 'react';
|
|
28
|
+
import { EuiExpression } from './expression';
|
|
29
|
+
import { EuiFieldNumber, EuiSelect } from '../form';
|
|
30
|
+
import { EuiFlexGroup, EuiFlexItem } from '../flex';
|
|
31
|
+
import { EuiPanel } from '../panel';
|
|
32
|
+
import { EuiPopover, EuiPopoverTitle } from '../popover';
|
|
33
|
+
import { useGeneratedHtmlId } from '../../services';
|
|
34
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
35
|
+
describe('EuiExpression', function () {
|
|
36
|
+
var BaseExpression = function BaseExpression() {
|
|
37
|
+
var _useState = useState({
|
|
38
|
+
isOpen: false,
|
|
39
|
+
value: 'count()'
|
|
40
|
+
}),
|
|
41
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
42
|
+
example1 = _useState2[0],
|
|
43
|
+
setExample1 = _useState2[1];
|
|
44
|
+
|
|
45
|
+
var _useState3 = useState({
|
|
46
|
+
value: 100,
|
|
47
|
+
description: 'Is above'
|
|
48
|
+
}),
|
|
49
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
50
|
+
example2 = _useState4[0],
|
|
51
|
+
setExample2 = _useState4[1];
|
|
52
|
+
|
|
53
|
+
var expressionPopoverId__1 = useGeneratedHtmlId({
|
|
54
|
+
prefix: 'expressionPopover',
|
|
55
|
+
suffix: 'first'
|
|
56
|
+
});
|
|
57
|
+
var expressionPopoverId__2 = useGeneratedHtmlId({
|
|
58
|
+
prefix: 'expressionPopover',
|
|
59
|
+
suffix: 'second'
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
var openExample1 = function openExample1() {
|
|
63
|
+
setExample1(_objectSpread(_objectSpread({}, example1), {}, {
|
|
64
|
+
isOpen: true
|
|
65
|
+
}));
|
|
66
|
+
setExample2(_objectSpread(_objectSpread({}, example2), {}, {
|
|
67
|
+
isOpen: false
|
|
68
|
+
}));
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
var closeExample1 = function closeExample1() {
|
|
72
|
+
setExample1(_objectSpread(_objectSpread({}, example1), {}, {
|
|
73
|
+
isOpen: false
|
|
74
|
+
}));
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
var openExample2 = function openExample2() {
|
|
78
|
+
setExample1(_objectSpread(_objectSpread({}, example1), {}, {
|
|
79
|
+
isOpen: false
|
|
80
|
+
}));
|
|
81
|
+
setExample2(_objectSpread(_objectSpread({}, example2), {}, {
|
|
82
|
+
isOpen: true
|
|
83
|
+
}));
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
var closeExample2 = function closeExample2() {
|
|
87
|
+
setExample2(_objectSpread(_objectSpread({}, example2), {}, {
|
|
88
|
+
isOpen: false
|
|
89
|
+
}));
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
var changeExample1 = function changeExample1(event) {
|
|
93
|
+
setExample1(_objectSpread(_objectSpread({}, example1), {}, {
|
|
94
|
+
value: event.target.value
|
|
95
|
+
}));
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
var changeExample2Value = function changeExample2Value(e) {
|
|
99
|
+
var sanitizedValue = parseInt(e.target.value, 10);
|
|
100
|
+
setExample2(_objectSpread(_objectSpread({}, example2), {}, {
|
|
101
|
+
value: isNaN(sanitizedValue) ? '' : sanitizedValue
|
|
102
|
+
}));
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
var changeExample2Description = function changeExample2Description(event) {
|
|
106
|
+
setExample2(_objectSpread(_objectSpread({}, example2), {}, {
|
|
107
|
+
description: event.target.value
|
|
108
|
+
}));
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
var renderPopover1 = function renderPopover1() {
|
|
112
|
+
return ___EmotionJSX("div", {
|
|
113
|
+
"data-test-subj": "cy-expression-popover-1"
|
|
114
|
+
}, ___EmotionJSX(EuiPopoverTitle, null, "When"), ___EmotionJSX(EuiSelect, {
|
|
115
|
+
compressed: true,
|
|
116
|
+
value: example1.value,
|
|
117
|
+
onChange: changeExample1,
|
|
118
|
+
options: [{
|
|
119
|
+
value: 'count()',
|
|
120
|
+
text: 'count()'
|
|
121
|
+
}, {
|
|
122
|
+
value: 'average()',
|
|
123
|
+
text: 'average()'
|
|
124
|
+
}, {
|
|
125
|
+
value: 'sum()',
|
|
126
|
+
text: 'sum()'
|
|
127
|
+
}, {
|
|
128
|
+
value: 'median()',
|
|
129
|
+
text: 'median()'
|
|
130
|
+
}, {
|
|
131
|
+
value: 'min()',
|
|
132
|
+
text: 'min()'
|
|
133
|
+
}, {
|
|
134
|
+
value: 'max()',
|
|
135
|
+
text: 'max()'
|
|
136
|
+
}]
|
|
137
|
+
}));
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
var renderPopover2 = function renderPopover2() {
|
|
141
|
+
return ___EmotionJSX("div", {
|
|
142
|
+
"data-test-subj": "cy-expression-popover-2"
|
|
143
|
+
}, ___EmotionJSX(EuiFlexGroup, {
|
|
144
|
+
gutterSize: "s"
|
|
145
|
+
}, ___EmotionJSX(EuiFlexItem, {
|
|
146
|
+
grow: false,
|
|
147
|
+
style: {
|
|
148
|
+
width: 150
|
|
149
|
+
}
|
|
150
|
+
}, ___EmotionJSX(EuiSelect, {
|
|
151
|
+
compressed: true,
|
|
152
|
+
value: example2.description,
|
|
153
|
+
onChange: changeExample2Description,
|
|
154
|
+
options: [{
|
|
155
|
+
value: 'Is above',
|
|
156
|
+
text: 'Is above'
|
|
157
|
+
}, {
|
|
158
|
+
value: 'Is below',
|
|
159
|
+
text: 'Is below'
|
|
160
|
+
}, {
|
|
161
|
+
value: 'Is exactly',
|
|
162
|
+
text: 'Is exactly'
|
|
163
|
+
}]
|
|
164
|
+
})), ___EmotionJSX(EuiFlexItem, {
|
|
165
|
+
grow: false,
|
|
166
|
+
style: {
|
|
167
|
+
width: 100
|
|
168
|
+
}
|
|
169
|
+
}, ___EmotionJSX(EuiFieldNumber, {
|
|
170
|
+
compressed: true,
|
|
171
|
+
value: example2.value,
|
|
172
|
+
onChange: changeExample2Value
|
|
173
|
+
}))));
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
return ___EmotionJSX(EuiPanel, null, ___EmotionJSX(EuiFlexGroup, {
|
|
177
|
+
gutterSize: "s"
|
|
178
|
+
}, ___EmotionJSX(EuiFlexItem, {
|
|
179
|
+
grow: false
|
|
180
|
+
}, ___EmotionJSX(EuiPopover, {
|
|
181
|
+
id: expressionPopoverId__1,
|
|
182
|
+
button: ___EmotionJSX(EuiExpression, {
|
|
183
|
+
description: "when",
|
|
184
|
+
value: example1.value,
|
|
185
|
+
isActive: example1.isOpen,
|
|
186
|
+
onClick: openExample1
|
|
187
|
+
}),
|
|
188
|
+
isOpen: example1.isOpen,
|
|
189
|
+
closePopover: closeExample1,
|
|
190
|
+
panelPaddingSize: "s",
|
|
191
|
+
anchorPosition: "downLeft"
|
|
192
|
+
}, renderPopover1())), ___EmotionJSX(EuiFlexItem, {
|
|
193
|
+
grow: false
|
|
194
|
+
}, ___EmotionJSX(EuiPopover, {
|
|
195
|
+
id: expressionPopoverId__2,
|
|
196
|
+
panelPaddingSize: "s",
|
|
197
|
+
button: ___EmotionJSX(EuiExpression, {
|
|
198
|
+
description: example2.description,
|
|
199
|
+
value: example2.value,
|
|
200
|
+
isActive: example2.isOpen,
|
|
201
|
+
onClick: openExample2
|
|
202
|
+
}),
|
|
203
|
+
isOpen: example2.isOpen,
|
|
204
|
+
closePopover: closeExample2,
|
|
205
|
+
anchorPosition: "downLeft"
|
|
206
|
+
}, renderPopover2()))));
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
beforeEach(function () {
|
|
210
|
+
cy.viewport(1024, 768); // medium breakpoint
|
|
211
|
+
|
|
212
|
+
cy.realMount(___EmotionJSX(BaseExpression, null));
|
|
213
|
+
});
|
|
214
|
+
describe('Automated accessibility check', function () {
|
|
215
|
+
it('has zero violations on first render', function () {
|
|
216
|
+
cy.checkAxe();
|
|
217
|
+
});
|
|
218
|
+
it('has zero violations when count popover is open', function () {
|
|
219
|
+
cy.get('button').contains(/When count\(\)/i).realClick();
|
|
220
|
+
cy.get('div[data-test-subj="cy-expression-popover-1"]').should('exist');
|
|
221
|
+
cy.checkAxe();
|
|
222
|
+
});
|
|
223
|
+
it('has zero violations when is above popover is open', function () {
|
|
224
|
+
cy.get('button').contains(/Is above 100/i).realClick();
|
|
225
|
+
cy.get('div[data-test-subj="cy-expression-popover-2"]').should('exist');
|
|
226
|
+
cy.checkAxe();
|
|
227
|
+
});
|
|
228
|
+
it('has zero violations when first popover is interacted with by keyboard', function () {
|
|
229
|
+
cy.realPress('Tab');
|
|
230
|
+
cy.get('button').contains(/When count\(\)/i).should('have.focus');
|
|
231
|
+
cy.realPress('Enter');
|
|
232
|
+
cy.get('div[data-test-subj="cy-expression-popover-1"]').should('exist');
|
|
233
|
+
cy.realPress('Tab');
|
|
234
|
+
cy.realPress(['a', 'v', 'g']);
|
|
235
|
+
cy.realPress('Escape');
|
|
236
|
+
cy.get('button').contains(/When average\(\)/i).should('have.focus');
|
|
237
|
+
cy.checkAxe();
|
|
238
|
+
});
|
|
239
|
+
it('has zero violations when second popover is interacted with by keyboard', function () {
|
|
240
|
+
cy.repeatRealPress('Tab');
|
|
241
|
+
cy.get('button').contains(/Is above 100/i).should('have.focus');
|
|
242
|
+
cy.realPress('Enter');
|
|
243
|
+
cy.get('div[data-test-subj="cy-expression-popover-2"]').should('exist');
|
|
244
|
+
cy.realPress('Tab');
|
|
245
|
+
cy.realPress(['I', 's', ' ', 'e']);
|
|
246
|
+
cy.realPress('Tab');
|
|
247
|
+
cy.repeatRealPress('Delete', 3);
|
|
248
|
+
cy.realPress(['5', '0', '0']);
|
|
249
|
+
cy.realPress('Escape');
|
|
250
|
+
cy.get('button').contains(/Is exactly 500/i).should('have.focus');
|
|
251
|
+
cy.checkAxe();
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
});
|