2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
require 'spec_helper'
|
2018-11-20 20:47:30 +05:30
|
|
|
|
2023-03-04 22:38:38 +05:30
|
|
|
RSpec.describe 'New issue breadcrumb', feature_category: :team_planning do
|
2020-03-13 15:44:24 +05:30
|
|
|
let_it_be(:project, reload: true) { create(:project) }
|
2021-09-30 23:02:18 +05:30
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
let(:user) { project.creator }
|
2018-11-20 20:47:30 +05:30
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
2019-02-15 15:39:39 +05:30
|
|
|
visit(new_project_issue_path(project))
|
2018-11-20 20:47:30 +05:30
|
|
|
end
|
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
it 'displays link to project issues and new issue' do
|
2018-11-20 20:47:30 +05:30
|
|
|
page.within '.breadcrumbs' do
|
|
|
|
expect(find_link('Issues')[:href]).to end_with(project_issues_path(project))
|
|
|
|
expect(find_link('New')[:href]).to end_with(new_project_issue_path(project))
|
|
|
|
end
|
|
|
|
end
|
2020-03-13 15:44:24 +05:30
|
|
|
|
|
|
|
it 'links to current issue in breadcrubs' do
|
|
|
|
issue = create(:issue, project: project)
|
|
|
|
|
|
|
|
visit project_issue_path(project, issue)
|
|
|
|
|
2022-07-16 23:28:13 +05:30
|
|
|
expect(find('[data-testid="breadcrumb-current-link"] a')[:href]).to end_with(issue_path(issue))
|
2020-03-13 15:44:24 +05:30
|
|
|
end
|
|
|
|
|
2022-07-16 23:28:13 +05:30
|
|
|
it 'excludes award_emoji from comment count', :js do
|
2020-03-13 15:44:24 +05:30
|
|
|
issue = create(:issue, author: user, assignees: [user], project: project, title: 'foobar')
|
|
|
|
create(:award_emoji, awardable: issue)
|
|
|
|
|
|
|
|
visit project_issues_path(project, assignee_id: user.id)
|
|
|
|
|
|
|
|
expect(page).to have_content 'foobar'
|
|
|
|
expect(page.all('.no-comments').first.text).to eq "0"
|
|
|
|
end
|
2018-11-20 20:47:30 +05:30
|
|
|
end
|