Browse Source

Fixed issue #1616 by adding adding observe active: true to org profile

Billy Zhou 6 years ago
parent
commit
fb0ef19e7d

+ 1 - 0
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) =>

+ 92 - 0
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