Skip to content
Snippets Groups Projects
Commit cd15d0e6 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent dd6afb4b
No related branches found
No related tags found
No related merge requests found
Showing
with 149 additions and 36 deletions
import Vue from 'vue';
import { file } from 'spec/ide/helpers';
import FileRow from '~/vue_shared/components/file_row.vue';
import FileRowExtra from '~/ide/components/file_row_extra.vue';
import { file } from 'spec/ide/helpers';
import mountComponent from '../../helpers/vue_mount_component_helper';
 
describe('File row component', () => {
Loading
Loading
import Vue from 'vue';
import component from '~/vue_shared/components/filtered_search_dropdown.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import component from '~/vue_shared/components/filtered_search_dropdown.vue';
 
describe('Filtered search dropdown', () => {
const Component = Vue.extend(component);
Loading
Loading
import Vue from 'vue';
import headerCi from '~/vue_shared/components/header_ci_component.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import headerCi from '~/vue_shared/components/header_ci_component.vue';
 
describe('Header CI Component', () => {
let HeaderCi;
Loading
Loading
import Vue from 'vue';
import Icon from '~/vue_shared/components/icon.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import { mount } from '@vue/test-utils';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import Icon from '~/vue_shared/components/icon.vue';
 
describe('Sprite Icon Component', function() {
describe('Initialization', function() {
Loading
Loading
import Vue from 'vue';
import loadingButton from '~/vue_shared/components/loading_button.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import loadingButton from '~/vue_shared/components/loading_button.vue';
 
const LABEL = 'Hello';
 
Loading
Loading
import Vue from 'vue';
import toolbar from '~/vue_shared/components/markdown/toolbar.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import toolbar from '~/vue_shared/components/markdown/toolbar.vue';
 
describe('toolbar', () => {
let vm;
Loading
Loading
import Vue from 'vue';
import navigationTabs from '~/vue_shared/components/navigation_tabs.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import navigationTabs from '~/vue_shared/components/navigation_tabs.vue';
 
describe('navigation tabs component', () => {
let vm;
Loading
Loading
import Vue from 'vue';
import panelResizer from '~/vue_shared/components/panel_resizer.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import panelResizer from '~/vue_shared/components/panel_resizer.vue';
 
describe('Panel Resizer component', () => {
let vm;
Loading
Loading
import Vue from 'vue';
import datePicker from '~/vue_shared/components/pikaday.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import datePicker from '~/vue_shared/components/pikaday.vue';
 
describe('datePicker', () => {
let vm;
Loading
Loading
import Vue from 'vue';
import ProjectAvatarDefault from '~/vue_shared/components/project_avatar/default.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import { projectData } from 'spec/ide/mock_data';
import { getFirstCharacterCapitalized } from '~/lib/utils/text_utility';
import { TEST_HOST } from 'spec/test_constants';
import { getFirstCharacterCapitalized } from '~/lib/utils/text_utility';
import ProjectAvatarDefault from '~/vue_shared/components/project_avatar/default.vue';
 
describe('ProjectAvatarDefault component', () => {
const Component = Vue.extend(ProjectAvatarDefault);
Loading
Loading
import ProjectListItem from '~/vue_shared/components/project_selector/project_list_item.vue';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { trimText } from 'spec/helpers/text_helper';
import ProjectListItem from '~/vue_shared/components/project_selector/project_list_item.vue';
 
const localVue = createLocalVue();
 
Loading
Loading
import Vue from 'vue';
import _ from 'underscore';
import ProjectSelector from '~/vue_shared/components/project_selector/project_selector.vue';
import ProjectListItem from '~/vue_shared/components/project_selector/project_list_item.vue';
 
import { GlSearchBoxByType, GlInfiniteScroll } from '@gitlab/ui';
import { mount, createLocalVue } from '@vue/test-utils';
import { trimText } from 'spec/helpers/text_helper';
import ProjectListItem from '~/vue_shared/components/project_selector/project_list_item.vue';
import ProjectSelector from '~/vue_shared/components/project_selector/project_selector.vue';
 
const localVue = createLocalVue();
 
Loading
Loading
import Vue from 'vue';
import SmartVirtualScrollList from '~/vue_shared/components/smart_virtual_list.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import SmartVirtualScrollList from '~/vue_shared/components/smart_virtual_list.vue';
 
describe('Toggle Button', () => {
let vm;
Loading
Loading
import Vue from 'vue';
 
import stackedProgressBarComponent from '~/vue_shared/components/stacked_progress_bar.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import stackedProgressBarComponent from '~/vue_shared/components/stacked_progress_bar.vue';
 
const createComponent = config => {
const Component = Vue.extend(stackedProgressBarComponent);
Loading
Loading
import Vue from 'vue';
import toggleButton from '~/vue_shared/components/toggle_button.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import toggleButton from '~/vue_shared/components/toggle_button.vue';
 
describe('Toggle Button', () => {
let vm;
Loading
Loading
import Vue from 'vue';
import UserAvatarSvg from '~/vue_shared/components/user_avatar/user_avatar_svg.vue';
import avatarSvg from 'icons/_icon_random.svg';
import UserAvatarSvg from '~/vue_shared/components/user_avatar/user_avatar_svg.vue';
 
const UserAvatarSvgComponent = Vue.extend(UserAvatarSvg);
 
Loading
Loading
import Vue from 'vue';
import Jed from 'jed';
 
import { trimText } from 'spec/helpers/text_helper';
import locale from '~/locale';
import Translate from '~/vue_shared/translate';
import { trimText } from 'spec/helpers/text_helper';
 
describe('Vue translate filter', () => {
let el;
Loading
Loading
Loading
Loading
@@ -3,6 +3,8 @@
require 'spec_helper'
 
describe Issuable do
include ProjectForksHelper
let(:issuable_class) { Issue }
let(:issue) { create(:issue, title: 'An issue', description: 'A description') }
let(:user) { create(:user) }
Loading
Loading
@@ -855,6 +857,7 @@ describe Issuable do
 
describe 'release scopes' do
let_it_be(:project) { create(:project) }
let(:forked_project) { fork_project(project) }
 
let_it_be(:release_1) { create(:release, tag: 'v1.0', project: project) }
let_it_be(:release_2) { create(:release, tag: 'v2.0', project: project) }
Loading
Loading
@@ -875,52 +878,65 @@ describe Issuable do
let_it_be(:issue_5) { create(:issue, milestone: milestone_6, project: project) }
let_it_be(:issue_6) { create(:issue, project: project) }
 
let_it_be(:items) { Issue.all }
let(:mr_1) { create(:merge_request, milestone: milestone_1, target_project: project, source_project: project) }
let(:mr_2) { create(:merge_request, milestone: milestone_3, target_project: project, source_project: forked_project) }
let(:mr_3) { create(:merge_request, source_project: project) }
let_it_be(:issue_items) { Issue.all }
let(:mr_items) { MergeRequest.all }
 
describe '#without_release' do
it 'returns the issues not tied to any milestone and the ones tied to milestone with no release' do
expect(items.without_release).to contain_exactly(issue_5, issue_6)
it 'returns the issues or mrs not tied to any milestone and the ones tied to milestone with no release' do
expect(issue_items.without_release).to contain_exactly(issue_5, issue_6)
expect(mr_items.without_release).to contain_exactly(mr_3)
end
end
 
describe '#any_release' do
it 'returns all issues tied to a release' do
expect(items.any_release).to contain_exactly(issue_1, issue_2, issue_3, issue_4)
it 'returns all issues or all mrs tied to a release' do
expect(issue_items.any_release).to contain_exactly(issue_1, issue_2, issue_3, issue_4)
expect(mr_items.any_release).to contain_exactly(mr_1, mr_2)
end
end
 
describe '#with_release' do
it 'returns the issues tied a specfic release' do
expect(items.with_release('v1.0', project.id)).to contain_exactly(issue_1, issue_2, issue_3)
it 'returns the issues tied to a specfic release' do
expect(issue_items.with_release('v1.0', project.id)).to contain_exactly(issue_1, issue_2, issue_3)
end
it 'returns the mrs tied to a specific release' do
expect(mr_items.with_release('v1.0', project.id)).to contain_exactly(mr_1)
end
 
context 'when a release has a milestone with one issue and another one with no issue' do
it 'returns that one issue' do
expect(items.with_release('v2.0', project.id)).to contain_exactly(issue_3)
expect(issue_items.with_release('v2.0', project.id)).to contain_exactly(issue_3)
end
 
context 'when the milestone with no issue is added as a filter' do
it 'returns an empty list' do
expect(items.with_release('v2.0', project.id).with_milestone('m3')).to be_empty
expect(issue_items.with_release('v2.0', project.id).with_milestone('m3')).to be_empty
end
end
 
context 'when the milestone with the issue is added as a filter' do
it 'returns this issue' do
expect(items.with_release('v2.0', project.id).with_milestone('m2')).to contain_exactly(issue_3)
expect(issue_items.with_release('v2.0', project.id).with_milestone('m2')).to contain_exactly(issue_3)
end
end
end
 
context 'when there is no issue under a specific release' do
it 'returns no issue' do
expect(items.with_release('v4.0', project.id)).to be_empty
context 'when there is no issue or mr under a specific release' do
it 'returns no issue or no mr' do
expect(issue_items.with_release('v4.0', project.id)).to be_empty
expect(mr_items.with_release('v4.0', project.id)).to be_empty
end
end
 
context 'when a non-existent release tag is passed in' do
it 'returns no issue' do
expect(items.with_release('v999.0', project.id)).to be_empty
it 'returns no issue or no mr' do
expect(issue_items.with_release('v999.0', project.id)).to be_empty
expect(mr_items.with_release('v999.0', project.id)).to be_empty
end
end
end
Loading
Loading
# frozen_string_literal: true
require 'spec_helper'
describe SentryDetailedErrorPresenter do
let(:error) { build(:detailed_error_tracking_error) }
let(:presenter) { described_class.new(error) }
describe '#frequency' do
subject { presenter.frequency }
it 'returns an array of frequency structs' do
expect(subject).to include(a_kind_of(SentryDetailedErrorPresenter::FrequencyStruct))
end
it 'converts the times into UTC time objects' do
time = subject.first.time
expect(time).to be_a(Time)
expect(time.strftime('%z')).to eq '+0000'
end
it 'returns the correct counts' do
count = subject.first.count
expect(count).to eq error.frequency.first[1]
end
end
end
# frozen_string_literal: true
require 'spec_helper'
describe 'getting a detailed sentry error' do
include GraphqlHelpers
let_it_be(:project) { create(:project, :repository) }
let_it_be(:project_setting) { create(:project_error_tracking_setting, project: project) }
let_it_be(:current_user) { project.owner }
let_it_be(:sentry_detailed_error) { build(:detailed_error_tracking_error) }
let(:sentry_gid) { sentry_detailed_error.to_global_id.to_s }
let(:fields) do
<<~QUERY
#{all_graphql_fields_for('SentryDetailedError'.classify)}
QUERY
end
let(:query) do
graphql_query_for(
'project',
{ 'fullPath' => project.full_path },
query_graphql_field('sentryDetailedError', { id: sentry_gid }, fields)
)
end
let(:error_data) { graphql_data['project']['sentryDetailedError'] }
it_behaves_like 'a working graphql query' do
before do
post_graphql(query, current_user: current_user)
end
end
context 'when data is loading via reactive cache' do
before do
post_graphql(query, current_user: current_user)
end
it "is expected to return an empty error" do
expect(error_data).to eq nil
end
end
context 'reactive cache returns data' do
before do
expect_any_instance_of(ErrorTracking::ProjectErrorTrackingSetting)
.to receive(:issue_details)
.and_return({ issue: sentry_detailed_error })
post_graphql(query, current_user: current_user)
end
it "is expected to return a valid error" do
expect(error_data['id']).to eql sentry_gid
expect(error_data['sentryId']).to eql sentry_detailed_error.id.to_s
expect(error_data['status']).to eql sentry_detailed_error.status.upcase
expect(error_data['firstSeen']).to eql sentry_detailed_error.first_seen
expect(error_data['lastSeen']).to eql sentry_detailed_error.last_seen
end
it 'is expected to return the frequency correctly' do
expect(error_data['frequency'].count).to eql sentry_detailed_error.frequency.count
first_frequency = error_data['frequency'].first
expect(Time.parse(first_frequency['time'])).to eql Time.at(sentry_detailed_error.frequency[0][0], in: 0)
expect(first_frequency['count']).to eql sentry_detailed_error.frequency[0][1]
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment