From fb0ef19e7d3bd7dcde92752c9e5e4f24421fb3fd Mon Sep 17 00:00:00 2001 From: Billy Zhou Date: Fri, 3 Aug 2018 20:55:15 +0800 Subject: [PATCH] Fixed issue #1616 by adding adding observe active: true to org profile --- .../controllers/organization_profile.coffee | 1 + .../agent_organization_profile_test.rb | 92 +++++++++++++++++++ 2 files changed, 93 insertions(+) diff --git a/app/assets/javascripts/app/controllers/organization_profile.coffee b/app/assets/javascripts/app/controllers/organization_profile.coffee index d3ed34840..b4c5f59e3 100644 --- a/app/assets/javascripts/app/controllers/organization_profile.coffee +++ b/app/assets/javascripts/app/controllers/organization_profile.coffee @@ -195,6 +195,7 @@ class Member extends App.ObserverController lastname: true login: true email: true + active: true globalRerender: false render: (user) => diff --git a/test/browser/agent_organization_profile_test.rb b/test/browser/agent_organization_profile_test.rb index 1a91bf94e..45d06494d 100644 --- a/test/browser/agent_organization_profile_test.rb +++ b/test/browser/agent_organization_profile_test.rb @@ -156,4 +156,96 @@ class AgentOrganizationProfileTest < TestCase value: message, ) end + + def test_org_profile_user_active_update + @browser = browser_instance + login( + username: 'master@example.com', + password: 'test', + url: browser_url, + ) + tasks_close_all() + + # search and open org + organization_open_by_search( + value: 'Zammad Foundation', + ) + + watch_for( + css: '.active .profile-window .userList-entry a.user-popover', + value: 'Nicole Braun', + ) + + exists( + css: '.active .profile-window .userList-entry .avatar--unique', + ) + + # open user and change status to inactive + click( + css: '.active .profile-window .userList-entry a.user-popover', + ) + click( + css: '.active .profile-window .dropdown #userAction', + ) + click( + css: '.active .profile-window .dropdown li[data-type="edit"]', + ) + modal_ready() + + select( + css: '.active .modal select[name="active"]', + value: 'inactive' + ) + + click( + css: '.modal .js-submit', + ) + + modal_disappear() + + # go back to the org and check for inactive status update + click( + css: '#navigation .nav-tab[data-key="Organization-1"]', + ) + + watch_for( + css: '.active .profile-window .userList-entry .avatar--unique.avatar--inactive', + ) + + # open user and change status to active again + click( + css: '.active .profile-window .userList-entry a.user-popover', + ) + click( + css: '.active .profile-window .dropdown #userAction', + ) + click( + css: '.active .profile-window .dropdown li[data-type="edit"]', + ) + modal_ready() + + select( + css: '.active .modal select[name="active"]', + value: 'active' + ) + + click( + css: '.modal .js-submit', + ) + + modal_disappear() + + # go back to the org and check for active status update + click( + css: '#navigation .nav-tab[data-key="Organization-1"]', + ) + + watch_for( + css: '.active .profile-window .userList-entry .avatar--unique', + ) + + exists_not( + css: '.active .profile-window .userList-entry .avatar--unique.avatar--inactive', + ) + end end