Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-25 12:08:30 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-25 12:08:30 +0300
commit03c3f9f501301f1da34bfec229348f8ac1b7c40d (patch)
tree90a71c76c2f2ba5d720d7f1138c6c1aa5fabeb13 /spec/frontend/monitoring
parent0ebaa8a2fd43938cee0d2074f84cdfd10f1e23d1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/monitoring')
-rw-r--r--spec/frontend/monitoring/components/dashboard_panel_spec.js4
-rw-r--r--spec/frontend/monitoring/components/graph_group_spec.js20
2 files changed, 24 insertions, 0 deletions
diff --git a/spec/frontend/monitoring/components/dashboard_panel_spec.js b/spec/frontend/monitoring/components/dashboard_panel_spec.js
index f8c9bd56721..bd2dd8dc5b2 100644
--- a/spec/frontend/monitoring/components/dashboard_panel_spec.js
+++ b/spec/frontend/monitoring/components/dashboard_panel_spec.js
@@ -126,6 +126,10 @@ describe('Dashboard Panel', () => {
expect(wrapper.find(MonitorEmptyChart).exists()).toBe(true);
expect(wrapper.find(MonitorEmptyChart).isVueInstance()).toBe(true);
});
+
+ it('does not contain a tabindex attribute', () => {
+ expect(wrapper.find(MonitorEmptyChart).contains('[tabindex]')).toBe(false);
+ });
});
describe('When graphData is null', () => {
diff --git a/spec/frontend/monitoring/components/graph_group_spec.js b/spec/frontend/monitoring/components/graph_group_spec.js
index 28a6af64394..92829135c0f 100644
--- a/spec/frontend/monitoring/components/graph_group_spec.js
+++ b/spec/frontend/monitoring/components/graph_group_spec.js
@@ -8,6 +8,7 @@ describe('Graph group component', () => {
const findGroup = () => wrapper.find({ ref: 'graph-group' });
const findContent = () => wrapper.find({ ref: 'graph-group-content' });
const findCaretIcon = () => wrapper.find(Icon);
+ const findToggleButton = () => wrapper.find('[data-testid="group-toggle-button"]');
const createComponent = propsData => {
wrapper = shallowMount(GraphGroup, {
@@ -41,6 +42,16 @@ describe('Graph group component', () => {
});
});
+ it('should contain a tabindex', () => {
+ expect(findGroup().contains('[tabindex]')).toBe(true);
+ });
+
+ it('should contain a tab index for the collapse button', () => {
+ const groupToggle = findToggleButton();
+
+ expect(groupToggle.contains('[tabindex]')).toBe(true);
+ });
+
it('should show the open the group when collapseGroup is set to true', () => {
wrapper.setProps({
collapseGroup: true,
@@ -69,6 +80,15 @@ describe('Graph group component', () => {
expect(wrapper.vm.caretIcon).toBe('angle-down');
});
+
+ it('should call collapse the graph group content when enter is pressed on the caret icon', () => {
+ const graphGroupContent = findContent();
+ const button = findToggleButton();
+
+ button.trigger('keyup.enter');
+
+ expect(graphGroupContent.isVisible()).toBe(false);
+ });
});
describe('When groups can not be collapsed', () => {