Browse Source

Maintenance: Add test for password handling.

Martin Gruner 9 months ago
parent
commit
96a22be1f0

+ 1 - 1
app/frontend/apps/mobile/pages/account/views/AccountOverview.vue

@@ -123,7 +123,7 @@ const { forceDesktop } = useForceDesktop()
         v-if="session.hasPermission('user_preferences.avatar')"
         :icon="{ name: 'person', size: 'base' }"
         icon-bg="bg-pink"
-        link="/user/current/avatar"
+        link="/account/avatar"
       >
         {{ $t('Avatar') }}
       </CommonSectionMenuLink>

+ 17 - 0
spec/system/apps/desktop/account_spec.rb

@@ -40,6 +40,23 @@ RSpec.describe 'Desktop > Account', app: :desktop_view, authenticated_as: :agent
     end
   end
 
+  describe 'password change' do
+    let(:agent) { create(:agent, password: 'test') }
+
+    it 'user can change password' do
+      click_on 'Profile settings'
+      click_on 'Password'
+
+      fill_in 'Current password', with: 'test'
+      fill_in 'New password', with: 'testTEST1234'
+      fill_in 'Confirm new password', with: 'testTEST1234'
+
+      click_on 'Change Password'
+
+      expect(page).to have_text('Password changed successfully')
+    end
+  end
+
   describe 'avatar handling', authenticated_as: :agent do
     let(:agent) { create(:agent, firstname: 'Jane', lastname: 'Doe') }