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>2023-07-25 15:08:22 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-07-25 15:08:22 +0300
commit5540824ee0e41db48486e378f03051832f521da6 (patch)
tree95138ba07fb4adbc503353ac3e47d65d565d70eb /spec
parentacad0870f7fd0cfe163a9d3a248a4a3eb8ca343d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/features/merge_request/user_sees_merge_widget_spec.rb9
-rw-r--r--spec/features/profiles/oauth_applications_spec.rb28
-rw-r--r--spec/frontend/issues/list/components/issues_list_app_spec.js19
-rw-r--r--spec/frontend/vue_merge_request_widget/components/mr_widget_pipeline_spec.js47
-rw-r--r--spec/lib/atlassian/jira_connect/serializers/deployment_entity_spec.rb10
-rw-r--r--spec/scripts/generate_message_to_run_e2e_pipeline_spec.rb9
-rw-r--r--spec/support/shared_examples/features/manage_applications_shared_examples.rb2
7 files changed, 95 insertions, 29 deletions
diff --git a/spec/features/merge_request/user_sees_merge_widget_spec.rb b/spec/features/merge_request/user_sees_merge_widget_spec.rb
index 3cac24838a3..75df93d1a6c 100644
--- a/spec/features/merge_request/user_sees_merge_widget_spec.rb
+++ b/spec/features/merge_request/user_sees_merge_widget_spec.rb
@@ -197,7 +197,8 @@ RSpec.describe 'Merge request > User sees merge widget', :js, feature_category:
it 'shows head pipeline information' do
within '.ci-widget-content' do
- expect(page).to have_content("Pipeline ##{pipeline.id} pending " \
+ expect(page).to have_content("Pipeline ##{pipeline.id} pending")
+ expect(page).to have_content("Pipeline pending " \
"for #{pipeline.short_sha} " \
"on #{pipeline.ref}")
end
@@ -227,7 +228,8 @@ RSpec.describe 'Merge request > User sees merge widget', :js, feature_category:
shared_examples 'pipeline widget' do
it 'shows head pipeline information', :sidekiq_might_not_need_inline do
within '.ci-widget-content' do
- expect(page).to have_content("Merge request pipeline ##{pipeline.id} pending for #{pipeline.short_sha}")
+ expect(page).to have_content("Merge request pipeline ##{pipeline.id} pending")
+ expect(page).to have_content("Merge request pipeline pending for #{pipeline.short_sha}")
end
end
end
@@ -266,7 +268,8 @@ RSpec.describe 'Merge request > User sees merge widget', :js, feature_category:
shared_examples 'pipeline widget' do
it 'shows head pipeline information', :sidekiq_might_not_need_inline do
within '.ci-widget-content' do
- expect(page).to have_content("Merged result pipeline ##{pipeline.id} pending for #{pipeline.short_sha}")
+ expect(page).to have_content("Merged result pipeline ##{pipeline.id} pending")
+ expect(page).to have_content("Merged result pipeline pending for #{pipeline.short_sha}")
end
end
end
diff --git a/spec/features/profiles/oauth_applications_spec.rb b/spec/features/profiles/oauth_applications_spec.rb
index d088f73f9df..0b1d67d00c9 100644
--- a/spec/features/profiles/oauth_applications_spec.rb
+++ b/spec/features/profiles/oauth_applications_spec.rb
@@ -25,15 +25,21 @@ RSpec.describe 'Profile > Applications', feature_category: :user_profile do
visit oauth_applications_path
page.within('.oauth-applications') do
- expect(page).to have_content('Your applications (1)')
+ page.within('.gl-new-card-count') do
+ expect(page).to have_content('1')
+ end
click_button 'Destroy'
end
accept_gl_confirm(button_text: 'Destroy')
expect(page).to have_content('The application was deleted successfully')
- expect(page).to have_content('Your applications (0)')
- expect(page).to have_content('Authorized applications (0)')
+ page.within('.oauth-applications .gl-new-card-count') do
+ expect(page).to have_content('0')
+ end
+ page.within('.oauth-authorized-applications .gl-new-card-count') do
+ expect(page).to have_content('0')
+ end
end
end
@@ -57,7 +63,9 @@ RSpec.describe 'Profile > Applications', feature_category: :user_profile do
it 'displays the correct authorized applications' do
visit oauth_applications_path
- expect(page).to have_content('Authorized applications (2)')
+ page.within('.oauth-authorized-applications .gl-new-card-count') do
+ expect(page).to have_content('2')
+ end
page.within('div.oauth-authorized-applications') do
# Ensure the correct user's token details are displayed
@@ -85,7 +93,9 @@ RSpec.describe 'Profile > Applications', feature_category: :user_profile do
accept_gl_confirm(button_text: 'Revoke application')
expect(page).to have_content('The application was revoked access.')
- expect(page).to have_content('Authorized applications (0)')
+ page.within('.oauth-authorized-applications .gl-new-card-count') do
+ expect(page).to have_content('0')
+ end
end
it 'deletes an anonymous authorized application' do
@@ -93,14 +103,18 @@ RSpec.describe 'Profile > Applications', feature_category: :user_profile do
visit oauth_applications_path
page.within('.oauth-authorized-applications') do
- expect(page).to have_content('Authorized applications (1)')
+ page.within('.oauth-authorized-applications .gl-new-card-count') do
+ expect(page).to have_content('1')
+ end
click_button 'Revoke'
end
accept_gl_confirm(button_text: 'Revoke application')
expect(page).to have_content('The application was revoked access.')
- expect(page).to have_content('Authorized applications (0)')
+ page.within('.oauth-authorized-applications .gl-new-card-count') do
+ expect(page).to have_content('0')
+ end
end
end
end
diff --git a/spec/frontend/issues/list/components/issues_list_app_spec.js b/spec/frontend/issues/list/components/issues_list_app_spec.js
index 31c6df953c6..2a0b002ae1f 100644
--- a/spec/frontend/issues/list/components/issues_list_app_spec.js
+++ b/spec/frontend/issues/list/components/issues_list_app_spec.js
@@ -74,6 +74,9 @@ import WorkItemDetail from '~/work_items/components/work_item_detail.vue';
import deleteWorkItemMutation from '~/work_items/graphql/delete_work_item.mutation.graphql';
import {
workItemResponseFactory,
+ workItemByIidResponseFactory,
+ mockAwardEmojiThumbsUp,
+ mockAwardsWidget,
mockAssignees,
mockLabels,
mockMilestone,
@@ -1137,6 +1140,22 @@ describe('CE IssuesListApp component', () => {
);
});
+ it('updates the upvotes count of active issuable', async () => {
+ const workItem = workItemByIidResponseFactory({
+ iid: '789',
+ awardEmoji: {
+ ...mockAwardsWidget,
+ nodes: [mockAwardEmojiThumbsUp],
+ },
+ }).data.workspace.workItems.nodes[0];
+
+ findDrawerWorkItem().vm.$emit('work-item-emoji-updated', workItem);
+
+ await waitForPromises();
+
+ expect(findIssuableList().props('issuables')[0].upvotes).toBe(1);
+ });
+
it('updates the milestone field of active issuable', async () => {
const {
data: { workItem },
diff --git a/spec/frontend/vue_merge_request_widget/components/mr_widget_pipeline_spec.js b/spec/frontend/vue_merge_request_widget/components/mr_widget_pipeline_spec.js
index 820e486c13f..98534624b32 100644
--- a/spec/frontend/vue_merge_request_widget/components/mr_widget_pipeline_spec.js
+++ b/spec/frontend/vue_merge_request_widget/components/mr_widget_pipeline_spec.js
@@ -28,6 +28,7 @@ describe('MRWidgetPipeline', () => {
const findCIErrorMessage = () => wrapper.findByTestId('ci-error-message');
const findPipelineID = () => wrapper.findByTestId('pipeline-id');
const findPipelineInfoContainer = () => wrapper.findByTestId('pipeline-info-container');
+ const findPipelineDetailsContainer = () => wrapper.findByTestId('pipeline-details-container');
const findCommitLink = () => wrapper.findByTestId('commit-link');
const findPipelineFinishedAt = () => wrapper.findByTestId('finished-at');
const findPipelineCoverage = () => wrapper.findByTestId('pipeline-coverage');
@@ -238,43 +239,77 @@ describe('MRWidgetPipeline', () => {
};
describe('for a branch pipeline', () => {
- it('renders a pipeline widget that reads "Pipeline <ID> <status> for <SHA> on <branch>"', () => {
+ it('renders a pipeline widget that reads "Pipeline <ID> <status>"', () => {
pipeline.ref.branch = true;
factory();
- const expected = `Pipeline #${pipeline.id} ${pipeline.details.status.label} for ${pipeline.commit.short_id} on ${mockData.source_branch_link}`;
+ const expected = `Pipeline #${pipeline.id} ${pipeline.details.status.label}`;
const actual = trimText(findPipelineInfoContainer().text());
expect(actual).toBe(expected);
});
+
+ it('renders a pipeline widget that reads "Pipeline <status> for <SHA> on <branch>"', () => {
+ pipeline.ref.branch = true;
+
+ factory();
+
+ const expected = `Pipeline ${pipeline.details.status.label} for ${pipeline.commit.short_id} on ${mockData.source_branch_link}`;
+ const actual = trimText(findPipelineDetailsContainer().text());
+
+ expect(actual).toBe(expected);
+ });
});
describe('for a tag pipeline', () => {
- it('renders a pipeline widget that reads "Pipeline <ID> <status> for <SHA> on <branch>"', () => {
+ it('renders a pipeline widget that reads "Pipeline <ID> <status>"', () => {
pipeline.ref.tag = true;
factory();
- const expected = `Pipeline #${pipeline.id} ${pipeline.details.status.label} for ${pipeline.commit.short_id}`;
+ const expected = `Pipeline #${pipeline.id} ${pipeline.details.status.label}`;
const actual = trimText(findPipelineInfoContainer().text());
expect(actual).toBe(expected);
});
+
+ it('renders a pipeline widget that reads "Pipeline <status> for <SHA> on <branch>"', () => {
+ pipeline.ref.tag = true;
+
+ factory();
+
+ const expected = `Pipeline ${pipeline.details.status.label} for ${pipeline.commit.short_id}`;
+ const actual = trimText(findPipelineDetailsContainer().text());
+
+ expect(actual).toBe(expected);
+ });
});
describe('for a detached merge request pipeline', () => {
- it('renders a pipeline widget that reads "Merge request pipeline <ID> <status> for <SHA>"', () => {
+ it('renders a pipeline widget that reads "Merge request pipeline <ID> <status>"', () => {
pipeline.details.event_type_name = 'Merge request pipeline';
pipeline.merge_request_event_type = 'detached';
factory();
- const expected = `Merge request pipeline #${pipeline.id} ${pipeline.details.status.label} for ${pipeline.commit.short_id}`;
+ const expected = `Merge request pipeline #${pipeline.id} ${pipeline.details.status.label}`;
const actual = trimText(findPipelineInfoContainer().text());
expect(actual).toBe(expected);
});
+
+ it('renders a pipeline widget that reads "Merge request pipeline <status> for <SHA>"', () => {
+ pipeline.details.event_type_name = 'Merge request pipeline';
+ pipeline.merge_request_event_type = 'detached';
+
+ factory();
+
+ const expected = `Merge request pipeline ${pipeline.details.status.label} for ${pipeline.commit.short_id}`;
+ const actual = trimText(findPipelineDetailsContainer().text());
+
+ expect(actual).toBe(expected);
+ });
});
});
});
diff --git a/spec/lib/atlassian/jira_connect/serializers/deployment_entity_spec.rb b/spec/lib/atlassian/jira_connect/serializers/deployment_entity_spec.rb
index 57e0b67e9e6..45ede09c7bb 100644
--- a/spec/lib/atlassian/jira_connect/serializers/deployment_entity_spec.rb
+++ b/spec/lib/atlassian/jira_connect/serializers/deployment_entity_spec.rb
@@ -92,16 +92,6 @@ RSpec.describe Atlassian::JiraConnect::Serializers::DeploymentEntity, feature_ca
expect(subject.issue_keys).to contain_exactly('add a')
end
- context 'when `jira_deployment_issue_keys` flag is disabled' do
- before do
- stub_feature_flags(jira_deployment_issue_keys: false)
- end
-
- it 'does not extract issue keys from commits' do
- expect(subject.issue_keys).to be_empty
- end
- end
-
context 'when deploy happened at an older commit' do
before do
# SHA is from a commit between 1) and 2) in the commit list above.
diff --git a/spec/scripts/generate_message_to_run_e2e_pipeline_spec.rb b/spec/scripts/generate_message_to_run_e2e_pipeline_spec.rb
index 61307937101..b1e2d5932ba 100644
--- a/spec/scripts/generate_message_to_run_e2e_pipeline_spec.rb
+++ b/spec/scripts/generate_message_to_run_e2e_pipeline_spec.rb
@@ -223,10 +223,13 @@ RSpec.describe GenerateMessageToRunE2ePipeline, feature_category: :tooling do
<<~MARKDOWN
<!-- Run e2e warning begin -->
:warning: @#{author_username} Some end-to-end (E2E) tests have been selected based on the stage label on this MR.
- If not run already, please run the `e2e:package-and-test-ee` job in the `qa` stage
- and review the results **before merging this MR**. (E2E tests are not run automatically on some MRs due to [runner resource constraints](https://gitlab.com/gitlab-org/gitlab-qa/-/issues/261).)
- If you would like to run all e2e tests, please apply the ~"pipeline:run-all-e2e" label and restart the pipeline.
+ Please start the `trigger-omnibus-and-follow-up-e2e` job in the `qa` stage and ensure the tests in `follow-up-e2e:package-and-test-ee` pipeline
+ are passing **before this MR is merged**.
+
+ If you would like to run all e2e tests, please apply the ~"pipeline:run-all-e2e" label and trigger a new pipeline. This will run all tests in `e2e:package-and-test` pipeline.
+
+ For the list of known failures please refer to [the latest pipeline triage issue](https://gitlab.com/gitlab-org/quality/pipeline-triage/-/issues).
Once done, please apply the ✅ emoji on this comment.
diff --git a/spec/support/shared_examples/features/manage_applications_shared_examples.rb b/spec/support/shared_examples/features/manage_applications_shared_examples.rb
index b8fd58e7efa..05b1c991cdb 100644
--- a/spec/support/shared_examples/features/manage_applications_shared_examples.rb
+++ b/spec/support/shared_examples/features/manage_applications_shared_examples.rb
@@ -10,6 +10,8 @@ RSpec.shared_examples 'manage applications' do
expect(page).to have_content 'Add new application'
+ click_button 'Add new application' if page.has_css?('.gl-new-card-header')
+
fill_in :doorkeeper_application_name, with: application_name
fill_in :doorkeeper_application_redirect_uri, with: application_redirect_uri
check :doorkeeper_application_scopes_read_user