pull/6386/head
Oliver Günther 6 years ago
parent ca4de761de
commit d47c986d27
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 2
      app/views/my/page.html.erb
  2. 37
      spec/features/my/blocks_spec.rb

@ -29,7 +29,7 @@ See docs/COPYRIGHT.rdoc for more details.
<% breadcrumb_paths(l(:label_my_page)) %> <% breadcrumb_paths(l(:label_my_page)) %>
<%= toolbar title: l(:label_my_page) do %> <%= toolbar title: l(:label_my_page) do %>
<li class="toolbar-item" title="<%= l(:label_personalize_page) %>"> <li class="toolbar-item" title="<%= l(:label_personalize_page) %>">
<%= link_to({ action: 'page_layout' }, accesskey: accesskey(:edit), class: 'button') do %> <%= link_to({ action: 'page_layout' }, accesskey: accesskey(:edit), class: 'button my-page--personalize-button') do %>
<%= op_icon('button--icon icon-settings') %> <%= op_icon('button--icon icon-settings') %>
<span class="hidden-for-sighted"><%= l(:label_personalize_page) %></span> <span class="hidden-for-sighted"><%= l(:label_personalize_page) %></span>
<% end %> <% end %>

@ -62,7 +62,7 @@ describe 'Blocks on the my page', type: :feature, js: true do
visit my_page_path visit my_page_path
end end
scenario 'viewing the blocks' do scenario 'viewing and modifying the blocks' do
# displays only the open and watched work packages for the watched block # displays only the open and watched work packages for the watched block
expect(page) expect(page)
.to have_selector('#top .wp-table--cell-td.subject', text: open_wp.subject) .to have_selector('#top .wp-table--cell-td.subject', text: open_wp.subject)
@ -70,5 +70,40 @@ describe 'Blocks on the my page', type: :feature, js: true do
.to have_no_selector('#top .wp-table--cell-td.subject', text: closed_wp.subject) .to have_no_selector('#top .wp-table--cell-td.subject', text: closed_wp.subject)
expect(page) expect(page)
.to have_no_selector('#top .wp-table--cell-td.subject', text: unwatched_wp.subject) .to have_no_selector('#top .wp-table--cell-td.subject', text: unwatched_wp.subject)
# Go to page layout
find('.my-page--personalize-button').click
# Add a block
select 'Calendar', from: 'block-options'
click_on 'Add'
# Expect block disabled
expect(page).to have_selector('#block-options option[value=calendar][disabled]')
within '#top' do
expect(page).to have_selector('#block-calendar')
end
# Add another block
select 'Latest news', from: 'block-options'
click_on 'Add'
expect(page).to have_selector('#block-options option[value=news][disabled]')
within '#top' do
expect(page).to have_selector('#block-news')
end
# Remove a block
within '#block-calendar' do
find('.my-page--remove-block').click
end
# Expect block reenabled
expect(page).to have_selector('#block-options option[value=calendar]')
expect(page).to have_no_selector('#block-options option[value=calendar][disabled]')
within '#top' do
expect(page).to have_no_selector('#block-calendar')
end
end end
end end

Loading…
Cancel
Save