diff options
author | Go MAEDA <maeda@farend.jp> | 2020-07-25 08:17:49 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2020-07-25 08:17:49 +0000 |
commit | e93febfda23b5fdc17d0bc1ad540b3ae926488c1 (patch) | |
tree | 3bd3d09096c903b6ab873add59f955f6ac1e2db9 /test/unit/lib/redmine | |
parent | 8d469912facd9497322fc6e8eedc4cfa0dddb88c (diff) | |
download | redmine-e93febfda23b5fdc17d0bc1ad540b3ae926488c1.tar.gz redmine-e93febfda23b5fdc17d0bc1ad540b3ae926488c1.zip |
Gantt bar is not displayed if the due date is the leftmost date or the start date is the rightmost date (#33140).
Patch by Yuichi HARADA.
git-svn-id: http://svn.redmine.org/redmine/trunk@19935 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/lib/redmine')
-rw-r--r-- | test/unit/lib/redmine/helpers/gantt_test.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/helpers/gantt_test.rb b/test/unit/lib/redmine/helpers/gantt_test.rb index 3e45735ef..770ae4719 100644 --- a/test/unit/lib/redmine/helpers/gantt_test.rb +++ b/test/unit/lib/redmine/helpers/gantt_test.rb @@ -44,6 +44,12 @@ class Redmine::Helpers::GanttHelperTest < Redmine::HelperTest def gantt_start @gantt.date_from end + private :gantt_start + + def gantt_end + @gantt.date_to + end + private :gantt_end # Creates a Gantt chart for a 4 week span def create_gantt(project=Project.generate!, options={}) @@ -354,6 +360,26 @@ class Redmine::Helpers::GanttHelperTest < Redmine::HelperTest assert_select 'div.task_todo[style*="left:28px"]', 1 end + test "#line todo line should appear if it ends on the leftmost date in the gantt" do + create_gantt + [gantt_start - 1, gantt_start].each do |start_date| + @output_buffer = @gantt.line(start_date, gantt_start, 30, false, 'line', :format => :html, :zoom => 4) + # the leftmost date (Date.today - 14 days) + assert_select 'div.task_todo[style*="left:0px"]', 1, @output_buffer + assert_select 'div.task_todo[style*="width:2px"]', 1, @output_buffer + end + end + + test "#line todo line should appear if it starts on the rightmost date in the gantt" do + create_gantt + [gantt_end, gantt_end + 1].each do |end_date| + @output_buffer = @gantt.line(gantt_end, end_date, 30, false, 'line', :format => :html, :zoom => 4) + # the rightmost date (Date.today + 14 days) + assert_select 'div.task_todo[style*="left:112px"]', 1, @output_buffer + assert_select 'div.task_todo[style*="width:2px"]', 1, @output_buffer + end + end + test "#line todo line should be the total width" do create_gantt @output_buffer = @gantt.line(today - 7, today + 7, 30, false, 'line', :format => :html, :zoom => 4) |