summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-06-22 09:08:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-22 09:08:42 +0000
commit5956978e1d2aa2b5b35c2d79f67f6b9706b8ec4e (patch)
tree30f01d7e265cf3c6884cd9343b916e2a46fc9d8c /spec
parentc11591217a3b923a0ce36e0259bbb88c2e1601e7 (diff)
downloadgitlab-ce-5956978e1d2aa2b5b35c2d79f67f6b9706b8ec4e.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/frontend/ide/components/repo_editor_spec.js10
-rw-r--r--spec/frontend/vue_shared/components/notes/noteable_warning_spec.js17
-rw-r--r--spec/lib/gitlab/ci/build/releaser_spec.rb4
-rw-r--r--spec/lib/gitlab/ci/build/step_spec.rb2
-rw-r--r--spec/requests/api/runner_spec.rb2
-rw-r--r--spec/services/spam/spam_verdict_service_spec.rb11
6 files changed, 18 insertions, 28 deletions
diff --git a/spec/frontend/ide/components/repo_editor_spec.js b/spec/frontend/ide/components/repo_editor_spec.js
index 0ba58561f08..a77edfc3fa8 100644
--- a/spec/frontend/ide/components/repo_editor_spec.js
+++ b/spec/frontend/ide/components/repo_editor_spec.js
@@ -546,7 +546,7 @@ describe('RepoEditor', () => {
store.state.viewer = viewerTypes.diff;
// we delay returning the file to make sure editor doesn't initialize before we fetch file content
- await waitUsingRealTimer(10);
+ await waitUsingRealTimer(30);
return 'rawFileData123\n';
});
@@ -555,8 +555,7 @@ describe('RepoEditor', () => {
vm.file = f;
- // use the real timer to accurately simulate the race condition
- await waitUsingRealTimer(20);
+ await waitForEditorSetup();
expect(vm.model.getModel().getValue()).toBe('rawFileData123\n');
});
@@ -575,14 +574,13 @@ describe('RepoEditor', () => {
})
.mockImplementationOnce(async () => {
// we delay returning fileB content to make sure the editor doesn't initialize prematurely
- await waitUsingRealTimer(10);
+ await waitUsingRealTimer(30);
return 'fileB-rawContent\n';
});
vm.file = fileA;
- // use the real timer to accurately simulate the race condition
- await waitUsingRealTimer(20);
+ await waitForEditorSetup();
expect(vm.model.getModel().getValue()).toBe('fileB-rawContent\n');
});
});
diff --git a/spec/frontend/vue_shared/components/notes/noteable_warning_spec.js b/spec/frontend/vue_shared/components/notes/noteable_warning_spec.js
index 67889c0cdb4..ae8c9a0928e 100644
--- a/spec/frontend/vue_shared/components/notes/noteable_warning_spec.js
+++ b/spec/frontend/vue_shared/components/notes/noteable_warning_spec.js
@@ -60,9 +60,12 @@ describe('Issue Warning Component', () => {
});
});
- it('renders information about confidential issue', () => {
+ it('renders information about confidential issue', async () => {
expect(findConfidentialBlock().exists()).toBe(true);
expect(findConfidentialBlock().element).toMatchSnapshot();
+
+ await wrapper.vm.$nextTick();
+ expect(findConfidentialBlock(wrapper).text()).toContain('This is a confidential issue.');
});
it('renders warning icon', () => {
@@ -142,13 +145,13 @@ describe('Issue Warning Component', () => {
it('renders confidential & locked messages with noteable "epic"', async () => {
wrapperLocked.setProps({
- noteableType: 'epic',
+ noteableType: 'Epic',
});
wrapperConfidential.setProps({
- noteableType: 'epic',
+ noteableType: 'Epic',
});
wrapperLockedAndConfidential.setProps({
- noteableType: 'epic',
+ noteableType: 'Epic',
});
await wrapperLocked.vm.$nextTick();
@@ -167,13 +170,13 @@ describe('Issue Warning Component', () => {
it('renders confidential & locked messages with noteable "merge request"', async () => {
wrapperLocked.setProps({
- noteableType: 'merge_request',
+ noteableType: 'MergeRequest',
});
wrapperConfidential.setProps({
- noteableType: 'merge_request',
+ noteableType: 'MergeRequest',
});
wrapperLockedAndConfidential.setProps({
- noteableType: 'merge_request',
+ noteableType: 'MergeRequest',
});
await wrapperLocked.vm.$nextTick();
diff --git a/spec/lib/gitlab/ci/build/releaser_spec.rb b/spec/lib/gitlab/ci/build/releaser_spec.rb
index 2f7bca777dd..b338cd3a2d2 100644
--- a/spec/lib/gitlab/ci/build/releaser_spec.rb
+++ b/spec/lib/gitlab/ci/build/releaser_spec.rb
@@ -19,7 +19,7 @@ describe Gitlab::Ci::Build::Releaser do
end
it 'generates the script' do
- expect(subject).to eq('release-cli create --name "Release $CI_COMMIT_SHA" --description "Created using the release-cli $EXTRA_DESCRIPTION" --tag-name "release-$CI_COMMIT_SHA" --ref "$CI_COMMIT_SHA"')
+ expect(subject).to eq(['release-cli create --name "Release $CI_COMMIT_SHA" --description "Created using the release-cli $EXTRA_DESCRIPTION" --tag-name "release-$CI_COMMIT_SHA" --ref "$CI_COMMIT_SHA"'])
end
end
@@ -43,7 +43,7 @@ describe Gitlab::Ci::Build::Releaser do
end
it 'generates the script' do
- expect(subject).to eq(result)
+ expect(subject).to eq([result])
end
end
end
diff --git a/spec/lib/gitlab/ci/build/step_spec.rb b/spec/lib/gitlab/ci/build/step_spec.rb
index 1cebda2cc7e..ea36d38bb10 100644
--- a/spec/lib/gitlab/ci/build/step_spec.rb
+++ b/spec/lib/gitlab/ci/build/step_spec.rb
@@ -62,7 +62,7 @@ describe Gitlab::Ci::Build::Step do
let(:job) { create(:ci_build, :release_options) }
it 'returns the release-cli command line' do
- expect(subject.script).to eq("release-cli create --name \"Release $CI_COMMIT_SHA\" --description \"Created using the release-cli $EXTRA_DESCRIPTION\" --tag-name \"release-$CI_COMMIT_SHA\" --ref \"$CI_COMMIT_SHA\"")
+ expect(subject.script).to eq(["release-cli create --name \"Release $CI_COMMIT_SHA\" --description \"Created using the release-cli $EXTRA_DESCRIPTION\" --tag-name \"release-$CI_COMMIT_SHA\" --ref \"$CI_COMMIT_SHA\""])
end
end
diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb
index fe1435826a0..fc0d4b91aa2 100644
--- a/spec/requests/api/runner_spec.rb
+++ b/spec/requests/api/runner_spec.rb
@@ -668,7 +668,7 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
{
"name" => "release",
"script" =>
- "release-cli create --ref \"$CI_COMMIT_SHA\" --name \"Release $CI_COMMIT_SHA\" --tag-name \"release-$CI_COMMIT_SHA\" --description \"Created using the release-cli $EXTRA_DESCRIPTION\"",
+ ["release-cli create --ref \"$CI_COMMIT_SHA\" --name \"Release $CI_COMMIT_SHA\" --tag-name \"release-$CI_COMMIT_SHA\" --description \"Created using the release-cli $EXTRA_DESCRIPTION\""],
"timeout" => 3600,
"when" => "on_success",
"allow_failure" => false
diff --git a/spec/services/spam/spam_verdict_service_spec.rb b/spec/services/spam/spam_verdict_service_spec.rb
index fe70da7a894..b9f9657f20f 100644
--- a/spec/services/spam/spam_verdict_service_spec.rb
+++ b/spec/services/spam/spam_verdict_service_spec.rb
@@ -81,17 +81,6 @@ describe Spam::SpamVerdictService do
end
end
- context 'and one is supported' do
- before do
- allow(service).to receive(:akismet_verdict).and_return('nonsense')
- allow(service).to receive(:spam_verdict).and_return(BLOCK_USER)
- end
-
- it 'renders the more restrictive verdict' do
- expect(subject).to eq BLOCK_USER
- end
- end
-
context 'and none are supported' do
before do
allow(service).to receive(:akismet_verdict).and_return('nonsense')