diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-03 00:06:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-03 00:06:22 +0300 |
commit | 6d60f910762c1a92a07a4afaf1b26962f75ee4b6 (patch) | |
tree | 0a9ef6ccb20aa2099df33a409723eb912f8029e3 /spec | |
parent | de2ae3154f4ba1c23eeaa4ace41177ecd9b6005a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
8 files changed, 23 insertions, 24 deletions
diff --git a/spec/frontend/notes/components/__snapshots__/discussion_jump_to_next_button_spec.js.snap b/spec/frontend/notes/components/__snapshots__/discussion_jump_to_next_button_spec.js.snap index 11d65ced180..b29d093130a 100644 --- a/spec/frontend/notes/components/__snapshots__/discussion_jump_to_next_button_spec.js.snap +++ b/spec/frontend/notes/components/__snapshots__/discussion_jump_to_next_button_spec.js.snap @@ -11,7 +11,6 @@ exports[`JumpToNextDiscussionButton matches the snapshot 1`] = ` title="" > <icon-stub - cssclasses="" name="comment-next" size="16" /> diff --git a/spec/frontend/sidebar/__snapshots__/confidential_issue_sidebar_spec.js.snap b/spec/frontend/sidebar/__snapshots__/confidential_issue_sidebar_spec.js.snap index fd1cfdb1b04..1f93336e755 100644 --- a/spec/frontend/sidebar/__snapshots__/confidential_issue_sidebar_spec.js.snap +++ b/spec/frontend/sidebar/__snapshots__/confidential_issue_sidebar_spec.js.snap @@ -14,7 +14,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = false and > <icon-stub aria-hidden="true" - cssclasses="" name="eye" size="16" /> @@ -40,7 +39,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = false and <icon-stub aria-hidden="true" class="sidebar-item-icon inline" - cssclasses="" name="eye" size="16" /> @@ -68,7 +66,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = false and > <icon-stub aria-hidden="true" - cssclasses="" name="eye" size="16" /> @@ -104,7 +101,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = false and <icon-stub aria-hidden="true" class="sidebar-item-icon inline" - cssclasses="" name="eye" size="16" /> @@ -132,7 +128,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = true and > <icon-stub aria-hidden="true" - cssclasses="" name="eye-slash" size="16" /> @@ -158,7 +153,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = true and <icon-stub aria-hidden="true" class="sidebar-item-icon inline is-active" - cssclasses="" name="eye-slash" size="16" /> @@ -186,7 +180,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = true and > <icon-stub aria-hidden="true" - cssclasses="" name="eye-slash" size="16" /> @@ -222,7 +215,6 @@ exports[`Confidential Issue Sidebar Block renders for isConfidential = true and <icon-stub aria-hidden="true" class="sidebar-item-icon inline is-active" - cssclasses="" name="eye-slash" size="16" /> diff --git a/spec/frontend/sidebar/__snapshots__/todo_spec.js.snap b/spec/frontend/sidebar/__snapshots__/todo_spec.js.snap index e680c917611..abcdf600a67 100644 --- a/spec/frontend/sidebar/__snapshots__/todo_spec.js.snap +++ b/spec/frontend/sidebar/__snapshots__/todo_spec.js.snap @@ -14,7 +14,7 @@ exports[`SidebarTodo template renders component container element with proper da type="button" > <icon-stub - cssclasses="todo-undone" + class="todo-undone" name="todo-done" size="16" style="display: none;" diff --git a/spec/frontend/sidebar/todo_spec.js b/spec/frontend/sidebar/todo_spec.js index b6cf799126b..c93bbadc264 100644 --- a/spec/frontend/sidebar/todo_spec.js +++ b/spec/frontend/sidebar/todo_spec.js @@ -44,7 +44,12 @@ describe('SidebarTodo', () => { ({ isTodo, iconClass, label, icon }) => { createComponent({ isTodo }); - expect(wrapper.find(Icon).props('cssClasses')).toStrictEqual(iconClass); + expect( + wrapper + .find(Icon) + .classes() + .join(' '), + ).toStrictEqual(iconClass); expect(wrapper.find(Icon).props('name')).toStrictEqual(icon); expect(wrapper.find('button').text()).toBe(label); }, diff --git a/spec/frontend/vue_shared/components/changed_file_icon_spec.js b/spec/frontend/vue_shared/components/changed_file_icon_spec.js index d0586f9e63f..d5861b18318 100644 --- a/spec/frontend/vue_shared/components/changed_file_icon_spec.js +++ b/spec/frontend/vue_shared/components/changed_file_icon_spec.js @@ -28,10 +28,7 @@ describe('Changed file icon', () => { const findIcon = () => wrapper.find(Icon); const findIconName = () => findIcon().props('name'); - const findIconClasses = () => - findIcon() - .props('cssClasses') - .split(' '); + const findIconClasses = () => findIcon().classes(); const findTooltipText = () => wrapper.attributes('data-original-title'); it('with isCentered true, adds center class', () => { diff --git a/spec/frontend/vue_shared/components/file_icon_spec.js b/spec/frontend/vue_shared/components/file_icon_spec.js index 328eec0a80a..f8f68a6a77a 100644 --- a/spec/frontend/vue_shared/components/file_icon_spec.js +++ b/spec/frontend/vue_shared/components/file_icon_spec.js @@ -49,7 +49,7 @@ describe('File Icon component', () => { }); expect(findIcon().exists()).toBe(false); - expect(wrapper.find(Icon).props('cssClasses')).toContain('folder-icon'); + expect(wrapper.find(Icon).classes()).toContain('folder-icon'); }); it('should render a loading icon', () => { diff --git a/spec/javascripts/vue_shared/components/icon_spec.js b/spec/javascripts/vue_shared/components/icon_spec.js index 45eef2ad737..7390798afa8 100644 --- a/spec/javascripts/vue_shared/components/icon_spec.js +++ b/spec/javascripts/vue_shared/components/icon_spec.js @@ -12,8 +12,6 @@ describe('Sprite Icon Component', function() { icon = mountComponent(IconComponent, { name: 'commit', size: 32, - cssClasses: 'extraclasses', - tabIndex: '0', }); }); @@ -47,10 +45,8 @@ describe('Sprite Icon Component', function() { it('should properly render img css', function() { const { classList } = icon.$el; const containsSizeClass = classList.contains('s32'); - const containsCustomClass = classList.contains('extraclasses'); expect(containsSizeClass).toBe(true); - expect(containsCustomClass).toBe(true); }); it('`name` validator should return false for non existing icons', () => { @@ -60,9 +56,5 @@ describe('Sprite Icon Component', function() { it('`name` validator should return false for existing icons', () => { expect(Icon.props.name.validator('commit')).toBe(true); }); - - it('should contain `tabindex` attribute on svg element when `tabIndex` prop is defined', () => { - expect(icon.$el.getAttribute('tabindex')).toBe('0'); - }); }); }); diff --git a/spec/lib/gitlab/metrics/requests_rack_middleware_spec.rb b/spec/lib/gitlab/metrics/requests_rack_middleware_spec.rb index c29db3a93ec..66ea390a2bf 100644 --- a/spec/lib/gitlab/metrics/requests_rack_middleware_spec.rb +++ b/spec/lib/gitlab/metrics/requests_rack_middleware_spec.rb @@ -63,5 +63,19 @@ describe Gitlab::Metrics::RequestsRackMiddleware do expect { subject.call(env) }.to raise_error(StandardError) end end + + describe '.initialize_http_request_duration_seconds' do + it "sets labels" do + expected_labels = [] + described_class::HTTP_METHODS.each do |method, statuses| + statuses.each do |status| + expected_labels << { method: method, status: status } + end + end + + described_class.initialize_http_request_duration_seconds + expect(described_class.http_request_duration_seconds.values.keys).to include(*expected_labels) + end + end end end |