diff --git a/reposilite-frontend/src/components/account/PasswordCard.test.ts b/reposilite-frontend/src/components/account/PasswordCard.test.ts index c82005712..cd8478e1f 100644 --- a/reposilite-frontend/src/components/account/PasswordCard.test.ts +++ b/reposilite-frontend/src/components/account/PasswordCard.test.ts @@ -19,6 +19,8 @@ import { mount, flushPromises, type VueWrapper } from '@vue/test-utils' import PasswordCard from './PasswordCard.vue' import { useSession } from '../../store/session' import { expectPrimitiveControls } from '../../helpers/primitiveControls' +import MdAlert from '../md/MdAlert.vue' +import type { Component } from 'vue' const toast = vi.hoisted(() => ({ success: vi.fn() })) @@ -152,6 +154,8 @@ describe('PasswordCard', () => { await submit() expect(wrapper.find('[role="alert"]').text()).toContain('The current password is wrong') + expect(wrapper.findComponent(MdAlert as Component).attributes('data-tone'), 'the wrong password is drawn with the error tone').toBe('error') + expect(wrapper.findComponent(MdAlert as Component).props('tone'), 'the error alert carries the error tone').toBe('error') expect(toast.success).not.toHaveBeenCalled() expect(wrapper.find('#account-new-password').element.value, 'the new password stays for another try').toBe('new-password-123') }) diff --git a/reposilite-frontend/src/components/account/PasswordCard.vue b/reposilite-frontend/src/components/account/PasswordCard.vue index 30c4f2396..b2e5d43e4 100644 --- a/reposilite-frontend/src/components/account/PasswordCard.vue +++ b/reposilite-frontend/src/components/account/PasswordCard.vue @@ -17,6 +17,7 @@