Commit 5e1c64a0 authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray Committed by Clement Ho

Add specs for showing epic metadata in epic list

and internationalized relevant strings
parent dbc3556e
......@@ -45,7 +45,7 @@
%ul.controls
- if issue.closed?
%li.issuable-status
CLOSED
= _('CLOSED')
- if issue.assignees.any?
%li
= render 'shared/issuable/assignees', project: @project, issuable: issue
......@@ -53,4 +53,5 @@
= render 'shared/issuable_meta_data', issuable: issue
.float-right.issuable-updated-at.d-none.d-sm-inline-block
%span updated #{time_ago_with_tooltip(issue.updated_at, placement: 'bottom', html_class: 'issue_update_ago')}
%span
= _('updated %{time_ago}').html_safe % { time_ago: time_ago_with_tooltip(issue.updated_at, placement: 'bottom', html_class: 'issue_update_ago') }
......@@ -41,11 +41,11 @@
%ul.controls.d-flex.align-items-end
- if merge_request.merged?
%li.issuable-status.d-none.d-sm-inline-block
MERGED
= _('MERGED')
- elsif merge_request.closed?
%li.issuable-status.d-none.d-sm-inline-block
= icon('ban')
CLOSED
= _('CLOSED')
- if can?(current_user, :read_pipeline, merge_request.head_pipeline)
%li.issuable-pipeline-status.d-none.d-sm-flex
= render 'ci/status/icon', status: merge_request.head_pipeline.detailed_status(current_user), option_css_classes: 'd-flex'
......@@ -61,4 +61,5 @@
= render 'shared/issuable_meta_data', issuable: merge_request
.float-right.issuable-updated-at.d-none.d-sm-inline-block
%span updated #{time_ago_with_tooltip(merge_request.updated_at, placement: 'bottom', html_class: 'merge_request_updated_ago')}
%span
= _('updated %{time_ago}').html_safe % { time_ago: time_ago_with_tooltip(merge_request.updated_at, placement: 'bottom', html_class: 'merge_request_updated_ago') }
......@@ -19,3 +19,15 @@
 
- epic.labels.each do |label|
= render_label(label.present(issuable_subject: @group), tooltip: true, link: group_epics_path(@group, label_name:[label.name]), css: 'label-link')
.issuable-meta
%ul.controls
- if epic.closed?
%li.issuable-status
= _('CLOSED')
= render 'shared/issuable_meta_data', issuable: epic
.float-right.issuable-updated-at.d-none.d-sm-inline-block
%span
= _('updated %{time_ago}').html_safe % { time_ago: time_ago_with_tooltip(epic.updated_at, placement: 'bottom', html_class: 'issue_update_ago') }
---
title: Add note count, updated timestamp, and closed tag to epics list view
merge_request:
author:
type: changed
......@@ -37,6 +37,15 @@ describe 'epics list', :js do
expect(first('.nav-sidebar .active a .count')).to have_content('3')
end
it 'shows epic updated date and comment count' do
page.within('.issuable-list') do
page.within('li:nth-child(1) .issuable-meta') do
expect(find('.issuable-updated-at')).to have_content('updated just now')
expect(find('.issuable-comments')).to have_content('0')
end
end
end
it 'renders the filtered search bar correctly' do
page.within('.content-wrapper .content') do
expect(page).to have_css('.epics-filters')
......@@ -50,15 +59,15 @@ describe 'epics list', :js do
expect(find('.top-area')).to have_content('All 3')
page.within('.issuable-list') do
page.within('li:nth-child(1)') do
page.within('li:nth-child(1) .issuable-main-info') do
expect(page).to have_content(epic3.title)
end
page.within('li:nth-child(2)') do
page.within('li:nth-child(2) .issuable-main-info') do
expect(page).to have_content(epic2.title)
end
page.within('li:nth-child(3)') do
page.within('li:nth-child(3) .issuable-main-info') do
expect(page).to have_content(epic1.title)
end
end
......@@ -84,15 +93,15 @@ describe 'epics list', :js do
expect(find('.top-area')).to have_content('All 3')
page.within('.issuable-list') do
page.within('li:nth-child(1)') do
page.within('li:nth-child(1) .issuable-main-info') do
expect(page).to have_content(epic3.title)
end
page.within('li:nth-child(2)') do
page.within('li:nth-child(2) .issuable-main-info') do
expect(page).to have_content(epic2.title)
end
page.within('li:nth-child(3)') do
page.within('li:nth-child(3) .issuable-main-info') do
expect(page).to have_content(epic1.title)
end
end
......@@ -150,6 +159,28 @@ describe 'epics list', :js do
end
end
context 'when closed epics exist for the group' do
let!(:epic1) { create(:epic, :closed, group: group, end_date: 10.days.ago) }
before do
visit group_epics_path(group)
end
it 'shows epic status, updated date and comment count' do
page.within('.epics-state-filters') do
click_link 'Closed'
end
page.within('.issuable-list') do
page.within('li:nth-child(1) .issuable-meta') do
expect(find('.issuable-status')).to have_content('CLOSED')
expect(find('.issuable-updated-at')).to have_content('updated just now')
expect(find('.issuable-comments')).to have_content('0')
end
end
end
end
context 'when no epics exist for the group' do
before do
visit group_epics_path(group)
......
......@@ -2554,6 +2554,9 @@ msgstr ""
msgid "CICD|instance enabled"
msgstr ""
msgid "CLOSED"
msgstr ""
msgid "CONTRIBUTING"
msgstr ""
......@@ -8841,6 +8844,9 @@ msgstr ""
msgid "Logs"
msgstr ""
msgid "MERGED"
msgstr ""
msgid "MRApprovals|Approved by"
msgstr ""
......@@ -18546,6 +18552,9 @@ msgstr ""
msgid "updated"
msgstr ""
msgid "updated %{time_ago}"
msgstr ""
msgid "user avatar"
msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment