diff options
author | Go MAEDA <maeda@farend.jp> | 2023-08-27 06:40:59 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2023-08-27 06:40:59 +0000 |
commit | 4e0bb4990ca4422c0d54b4cf1707a4025989b64f (patch) | |
tree | cbef1701962cdbb60dded88ff1bc80eb69646dc8 /test/functional | |
parent | 6653f60d7454aa927840eced55b20bde77adbc16 (diff) | |
download | redmine-4e0bb4990ca4422c0d54b4cf1707a4025989b64f.tar.gz redmine-4e0bb4990ca4422c0d54b4cf1707a4025989b64f.zip |
Display calendar in vertical list layout on mobile screens (#33682).
Patch by Takashi Kato.
git-svn-id: https://svn.redmine.org/redmine/trunk@22283 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/calendars_controller_test.rb | 164 | ||||
-rw-r--r-- | test/functional/my_controller_test.rb | 32 |
2 files changed, 91 insertions, 105 deletions
diff --git a/test/functional/calendars_controller_test.rb b/test/functional/calendars_controller_test.rb index e5a4a6e94..b6dcbdf01 100644 --- a/test/functional/calendars_controller_test.rb +++ b/test/functional/calendars_controller_test.rb @@ -65,19 +65,17 @@ class CalendarsControllerTest < Redmine::ControllerTest # Assert context menu on issues assert_select 'form[data-cm-url=?]', '/issues/context_menu' - assert_select 'table.cal' do - assert_select 'tr' do - assert_select 'td' do - assert_select( - 'div.issue.hascontextmenu.tooltip.starting', - :text => /Add ingredients categories/ - ) do - assert_select 'a.issue[href=?]', '/issues/2', :text => 'Feature request #2' - assert_select 'span.tip' do - assert_select 'img[class="gravatar"]' - end - assert_select 'input[name=?][type=?][value=?]', 'ids[]', 'checkbox', '2' + assert_select 'ul.cal' do + assert_select 'li' do + assert_select( + 'div.issue.hascontextmenu.tooltip.starting', + :text => /Add ingredients categories/ + ) do + assert_select 'a.issue[href=?]', '/issues/2', :text => 'Feature request #2' + assert_select 'span.tip' do + assert_select 'img[class="gravatar"]' end + assert_select 'input[name=?][type=?][value=?]', 'ids[]', 'checkbox', '2' end end end @@ -89,16 +87,14 @@ class CalendarsControllerTest < Redmine::ControllerTest get(:show, :params => {:project_id => 1}) assert_response :success - assert_select 'table.cal' do - assert_select 'tr' do - assert_select 'td' do - assert_select( - 'div.issue.hascontextmenu.tooltip.ending', - :text => /Cannot print recipes/ - ) do - assert_select 'a.issue[href=?]', '/issues/1', :text => 'Bug #1' - assert_select 'input[name=?][type=?][value=?]', 'ids[]', 'checkbox', '1' - end + assert_select 'ul.cal' do + assert_select 'li' do + assert_select( + 'div.issue.hascontextmenu.tooltip.ending', + :text => /Cannot print recipes/ + ) do + assert_select 'a.issue[href=?]', '/issues/1', :text => 'Bug #1' + assert_select 'input[name=?][type=?][value=?]', 'ids[]', 'checkbox', '1' end end end @@ -120,24 +116,22 @@ class CalendarsControllerTest < Redmine::ControllerTest ) assert_response :success - assert_select 'table.cal' do - assert_select 'tr' do - assert_select 'td' do + assert_select 'ul.cal' do + assert_select 'li' do + assert_select( + 'div.issue.hascontextmenu.tooltip.starting.ending', + :text => /#{subject}/ + ) do assert_select( - 'div.issue.hascontextmenu.tooltip.starting.ending', - :text => /#{subject}/ - ) do - assert_select( - 'a.issue[href=?]', "/issues/#{issue.id}", - :text => "Bug ##{issue.id}" - ) - assert_select( - 'input[name=?][type=?][value=?]', - 'ids[]', - 'checkbox', - issue.id.to_s - ) - end + 'a.issue[href=?]', "/issues/#{issue.id}", + :text => "Bug ##{issue.id}" + ) + assert_select( + 'input[name=?][type=?][value=?]', + 'ids[]', + 'checkbox', + issue.id.to_s + ) end end end @@ -149,14 +143,12 @@ class CalendarsControllerTest < Redmine::ControllerTest get(:show, :params => {:project_id => 1}) assert_response :success - assert_select 'table.cal' do - assert_select 'tr' do - assert_select 'td' do - assert_select( - 'span.icon.icon-package' - ) do - assert_select 'a[href=?]', '/versions/2', :text => '1.0' - end + assert_select 'ul.cal' do + assert_select 'li' do + assert_select( + 'span.icon.icon-package' + ) do + assert_select 'a[href=?]', '/versions/2', :text => '1.0' end end end @@ -179,16 +171,14 @@ class CalendarsControllerTest < Redmine::ControllerTest get :show assert_response :success - assert_select 'table.cal' do - assert_select 'tr' do - assert_select 'td' do - assert_select( - 'div.issue.hascontextmenu.tooltip.starting', - :text => /eCookbook.*Add ingredients categories/m - ) do - assert_select 'a.issue[href=?]', '/issues/2', :text => 'Feature request #2' - assert_select 'input[name=?][type=?][value=?]', 'ids[]', 'checkbox', '2' - end + assert_select 'ul.cal' do + assert_select 'li' do + assert_select( + 'div.issue.hascontextmenu.tooltip.starting', + :text => /eCookbook.*Add ingredients categories/m + ) do + assert_select 'a.issue[href=?]', '/issues/2', :text => 'Feature request #2' + assert_select 'input[name=?][type=?][value=?]', 'ids[]', 'checkbox', '2' end end end @@ -200,17 +190,15 @@ class CalendarsControllerTest < Redmine::ControllerTest get :show assert_response :success - assert_select 'table.cal' do - assert_select 'tr' do - assert_select 'td' do + assert_select 'ul.cal' do + assert_select 'li' do + assert_select( + 'span.icon.icon-package' + ) do assert_select( - 'span.icon.icon-package' - ) do - assert_select( - 'a[href=?]', '/versions/2', - :text => 'eCookbook - 1.0' - ) - end + 'a[href=?]', '/versions/2', + :text => 'eCookbook - 1.0' + ) end end end @@ -228,16 +216,16 @@ class CalendarsControllerTest < Redmine::ControllerTest assert_response :success end - assert_select 'tr' do - assert_select 'td.week-number', :text => '53' - assert_select 'td.odd', :text => '27' - assert_select 'td.even', :text => '2' + assert_select 'ul' do + assert_select 'li.week-number:nth-of-type(2)', :text => /53$/ + assert_select 'li.odd', :text => /^27/ + assert_select 'li.even', :text => /^2/ end - assert_select 'tr' do - assert_select 'td.week-number', :text => '1' - assert_select 'td.odd', :text => '3' - assert_select 'td.even', :text => '9' + assert_select 'ul' do + assert_select 'li.week-number', :text => /1$/ + assert_select 'li.odd', :text => /^3/ + assert_select 'li.even', :text => /^9/ end with_settings :start_of_week => 1 do @@ -251,16 +239,16 @@ class CalendarsControllerTest < Redmine::ControllerTest assert_response :success end - assert_select 'tr' do - assert_select 'td.week-number', :text => '53' - assert_select 'td.even', :text => '28' - assert_select 'td.even', :text => '3' + assert_select 'ul' do + assert_select 'li.week-number:nth-of-type(2)', :text => /53$/ + assert_select 'li.even', :text => /^28/ + assert_select 'li.even', :text => /^3/ end - assert_select 'tr' do - assert_select 'td.week-number', :text => '1' - assert_select 'td.even', :text => '4' - assert_select 'td.even', :text => '10' + assert_select 'ul' do + assert_select 'li.week-number', :text => /1$/ + assert_select 'li.even', :text => /^4/ + assert_select 'li.even', :text => /^10/ end end @@ -296,12 +284,12 @@ class CalendarsControllerTest < Redmine::ControllerTest ) assert_response :success - assert_select 'tr:nth-child(2)' do - assert_select 'td.week-number', :text => '49' + assert_select 'ul' do + assert_select 'li.week-number:nth-of-type(2)', :text => /48$/ # non working days should have "nwday" CSS class - assert_select 'td.nwday', 2 - assert_select 'td.nwday', :text => '4' - assert_select 'td.nwday', :text => '10' + assert_select 'li.nwday', 10 + assert_select 'li.nwday', :text => /^4/ + assert_select 'li.nwday', :text => /^10/ end end end diff --git a/test/functional/my_controller_test.rb b/test/functional/my_controller_test.rb index c061f67ab..cb3014fda 100644 --- a/test/functional/my_controller_test.rb +++ b/test/functional/my_controller_test.rb @@ -444,24 +444,22 @@ class MyControllerTest < Redmine::ControllerTest assert_select 'form[data-cm-url=?]', '/issues/context_menu' - assert_select 'table.cal' do - assert_select 'tr' do - assert_select 'td' do + assert_select 'ul.cal' do + assert_select 'li' do + assert_select( + 'div.issue.hascontextmenu.tooltip.starting.ending', + :text => /eCookbook.*#{subject}/m + ) do + assert_select( + 'a.issue[href=?]', "/issues/#{issue.id}", + :text => "Bug ##{issue.id}" + ) assert_select( - 'div.issue.hascontextmenu.tooltip.starting.ending', - :text => /eCookbook.*#{subject}/m - ) do - assert_select( - 'a.issue[href=?]', "/issues/#{issue.id}", - :text => "Bug ##{issue.id}" - ) - assert_select( - 'input[name=?][type=?][value=?]', - 'ids[]', - 'checkbox', - issue.id.to_s - ) - end + 'input[name=?][type=?][value=?]', + 'ids[]', + 'checkbox', + issue.id.to_s + ) end end end |