Skip to content

Commit

Permalink
Merge pull request #3067 from fjordllc/feature/change-show-counter-on…
Browse files Browse the repository at this point in the history
…-products-menu

【メンター向け機能】左メニューの提出物ボタンに表示される数を未アサインの提出物数に変更
  • Loading branch information
komagata authored Aug 8, 2021
2 parents f8bcfc3 + 37a57d8 commit c01d04a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/views/application/_global_nav.slim
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ nav.global-nav
= link_to products_link, class: "global-nav-links__link #{current_link(/^products/)}" do
.global-nav-links__link-icon
i.fas.fa-fw.fa-hand-paper
- if admin_or_mentor_login? && Cache.not_responded_product_count.positive?
- if admin_login? || mentor_login? && Cache.unassigned_product_count.positive?
.global-nav__item-count.a-notification-count.is-only-mentor
= Cache.not_responded_product_count
= Cache.unassigned_product_count
.global-nav-links__link-label 提出物
li.global-nav-links__item
= link_to questions_path, class: "global-nav-links__link #{current_link(/^questions/)}" do
Expand Down
30 changes: 29 additions & 1 deletion test/system/products_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,35 @@ def assigned_product_count
click_button '編集'
fill_in 'js-user-mentor-memo', with: '編集後のユーザーメモです。'
click_button '保存する'
assert_text '編集後のユーザーメモです。'
end

test 'can see unassigned-tab' do
visit_with_auth products_path, 'komagata'
assert find('.page-tabs__item-link', text: '未アサイン')
end

test 'can access unassigned products page after click unassigned-tab' do
visit_with_auth products_path, 'komagata'
find('.page-tabs__item-link', text: '未アサイン').click
assert find('h2.page-header__title', text: '未アサインの提出物')
end

test 'show unassigned products counter and can change counter after click assignee-button on unassigned-tab' do
visit_with_auth products_path, 'komagata'
unassigned_tab = find('.page-tabs__item-link', text: '未アサイン')
within(unassigned_tab) do
assert_selector('.page-tabs__item-count.a-notification-count')
end

initial_counter = unassigned_tab.text

assignee_buttons = all('.a-button.is-block.is-secondary.is-sm', text: '担当する')
assignee_buttons.first(3).each(&:click)

unassigned_tab.click
wait_for_vuejs
operated_counter = find('.page-tabs__item-link.is-active', text: '未アサイン').text
assert_not_equal initial_counter, operated_counter
end

test 'can see unassigned-tab' do
Expand Down

0 comments on commit c01d04a

Please sign in to comment.