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
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-10 12:10:04 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-10 12:10:04 +0300
commit67b0b1c43f3d705b92f62ef231dfce1d7f3c0a30 (patch)
treee5fe64819687cbc794f243a5166df59b3988ce36 /spec
parentf9d25383cf2654e14741c46823417a1a4296ea82 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/features/boards/new_issue_spec.rb8
-rw-r--r--spec/frontend/boards/board_list_spec.js1
-rw-r--r--spec/frontend/boards/components/board_list_header_deprecated_spec.js13
-rw-r--r--spec/frontend/boards/components/board_list_header_spec.js14
-rw-r--r--spec/presenters/release_presenter_spec.rb40
5 files changed, 22 insertions, 54 deletions
diff --git a/spec/features/boards/new_issue_spec.rb b/spec/features/boards/new_issue_spec.rb
index d423377886a..e055e8092d4 100644
--- a/spec/features/boards/new_issue_spec.rb
+++ b/spec/features/boards/new_issue_spec.rb
@@ -154,8 +154,8 @@ RSpec.describe 'Issue Boards new issue', :js do
wait_for_requests
end
- it 'displays new issue button in open list' do
- expect(first('.board')).to have_button('New issue', count: 1)
+ it 'does not display new issue button in open list' do
+ expect(first('.board')).not_to have_button('New issue')
end
it 'does not display new issue button in label list' do
@@ -192,8 +192,8 @@ RSpec.describe 'Issue Boards new issue', :js do
context 'when backlog list already exists' do
let_it_be(:backlog_list) { create(:backlog_list, board: group_board) }
- it 'displays new issue button in open list' do
- expect(first('.board')).to have_button('New issue', count: 1)
+ it 'does not display new issue button in open list' do
+ expect(first('.board')).not_to have_button('New issue')
end
it 'does not display new issue button in label list' do
diff --git a/spec/frontend/boards/board_list_spec.js b/spec/frontend/boards/board_list_spec.js
index e6060a2c4f8..76629c96f22 100644
--- a/spec/frontend/boards/board_list_spec.js
+++ b/spec/frontend/boards/board_list_spec.js
@@ -80,6 +80,7 @@ const createComponent = ({
rootPath: '/',
weightFeatureAvailable: false,
boardWeight: null,
+ canAdminList: true,
},
stubs: {
BoardCard,
diff --git a/spec/frontend/boards/components/board_list_header_deprecated_spec.js b/spec/frontend/boards/components/board_list_header_deprecated_spec.js
index fdc7cd2b1d4..db79e67fe78 100644
--- a/spec/frontend/boards/components/board_list_header_deprecated_spec.js
+++ b/spec/frontend/boards/components/board_list_header_deprecated_spec.js
@@ -31,6 +31,7 @@ describe('Board List Header Component', () => {
listType = ListType.backlog,
collapsed = false,
withLocalStorage = true,
+ currentUserId = 1,
} = {}) => {
const boardId = '1';
@@ -62,6 +63,7 @@ describe('Board List Header Component', () => {
},
provide: {
boardId,
+ currentUserId,
},
});
};
@@ -100,10 +102,12 @@ describe('Board List Header Component', () => {
});
});
- it('does render when logged out', () => {
- createComponent();
+ it('does not render when logged out', () => {
+ createComponent({
+ currentUserId: null,
+ });
- expect(findAddIssueButton().exists()).toBe(true);
+ expect(findAddIssueButton().exists()).toBe(false);
});
});
@@ -143,7 +147,6 @@ describe('Board List Header Component', () => {
it("when logged in it calls list update and doesn't set localStorage", () => {
jest.spyOn(List.prototype, 'update');
- window.gon.current_user_id = 1;
createComponent({ withLocalStorage: false });
@@ -158,7 +161,7 @@ describe('Board List Header Component', () => {
it("when logged out it doesn't call list update and sets localStorage", () => {
jest.spyOn(List.prototype, 'update');
- createComponent();
+ createComponent({ currentUserId: null });
findCaret().vm.$emit('click');
diff --git a/spec/frontend/boards/components/board_list_header_spec.js b/spec/frontend/boards/components/board_list_header_spec.js
index d2dfb4148b3..0abb00e0fa5 100644
--- a/spec/frontend/boards/components/board_list_header_spec.js
+++ b/spec/frontend/boards/components/board_list_header_spec.js
@@ -28,7 +28,7 @@ describe('Board List Header Component', () => {
listType = ListType.backlog,
collapsed = false,
withLocalStorage = true,
- currentUserId = null,
+ currentUserId = 1,
} = {}) => {
const boardId = '1';
@@ -109,10 +109,12 @@ describe('Board List Header Component', () => {
});
});
- it('does render when logged out', () => {
- createComponent();
+ it('does not render when logged out', () => {
+ createComponent({
+ currentUserId: null,
+ });
- expect(findAddIssueButton().exists()).toBe(true);
+ expect(findAddIssueButton().exists()).toBe(false);
});
});
@@ -153,7 +155,9 @@ describe('Board List Header Component', () => {
});
it("when logged out it doesn't call list update and sets localStorage", async () => {
- createComponent();
+ createComponent({
+ currentUserId: null,
+ });
findCaret().vm.$emit('click');
await wrapper.vm.$nextTick();
diff --git a/spec/presenters/release_presenter_spec.rb b/spec/presenters/release_presenter_spec.rb
index 97c05a1b7a2..b2e7b684644 100644
--- a/spec/presenters/release_presenter_spec.rb
+++ b/spec/presenters/release_presenter_spec.rb
@@ -77,14 +77,6 @@ RSpec.describe ReleasePresenter do
it 'returns merge requests url with state=open' do
is_expected.to eq(project_merge_requests_url(project, opened_url_params))
end
-
- context 'when release_mr_issue_urls feature flag is disabled' do
- before do
- stub_feature_flags(release_mr_issue_urls: false)
- end
-
- it { is_expected.to be_nil }
- end
end
describe '#merged_merge_requests_url' do
@@ -93,14 +85,6 @@ RSpec.describe ReleasePresenter do
it 'returns merge requests url with state=merged' do
is_expected.to eq(project_merge_requests_url(project, merged_url_params))
end
-
- context 'when release_mr_issue_urls feature flag is disabled' do
- before do
- stub_feature_flags(release_mr_issue_urls: false)
- end
-
- it { is_expected.to be_nil }
- end
end
describe '#closed_merge_requests_url' do
@@ -109,14 +93,6 @@ RSpec.describe ReleasePresenter do
it 'returns merge requests url with state=closed' do
is_expected.to eq(project_merge_requests_url(project, closed_url_params))
end
-
- context 'when release_mr_issue_urls feature flag is disabled' do
- before do
- stub_feature_flags(release_mr_issue_urls: false)
- end
-
- it { is_expected.to be_nil }
- end
end
describe '#opened_issues_url' do
@@ -125,14 +101,6 @@ RSpec.describe ReleasePresenter do
it 'returns issues url with state=open' do
is_expected.to eq(project_issues_url(project, opened_url_params))
end
-
- context 'when release_mr_issue_urls feature flag is disabled' do
- before do
- stub_feature_flags(release_mr_issue_urls: false)
- end
-
- it { is_expected.to be_nil }
- end
end
describe '#closed_issues_url' do
@@ -141,14 +109,6 @@ RSpec.describe ReleasePresenter do
it 'returns issues url with state=closed' do
is_expected.to eq(project_issues_url(project, closed_url_params))
end
-
- context 'when release_mr_issue_urls feature flag is disabled' do
- before do
- stub_feature_flags(release_mr_issue_urls: false)
- end
-
- it { is_expected.to be_nil }
- end
end
describe '#edit_url' do