import { describe, it, expect } from 'vitest'; import { mount } from '@vue/test-utils'; import { createVuetify } from 'vuetify'; import ChangePasswordCard from '../../resources/js/components/settings/security/ChangePasswordCard.vue'; const vuetify = createVuetify(); describe('ChangePasswordCard (Q.DEFER.003 sub-B)', () => { const factory = () => mount(ChangePasswordCard, { global: { plugins: [vuetify] } }); it('renders heading «Пароль»', () => { const wrapper = factory(); expect(wrapper.find('h3').text()).toBe('Пароль'); }); it('shows last-change hint text', () => { // Дата берётся из GET /api/account/security; без backend (в тесте) — честное // «не менялся» (хардкод-демо «12.04.2026» убран намеренно, не показываем фейк). const wrapper = factory(); expect(wrapper.text()).toContain('Последняя смена: не менялся'); }); it('renders «Сменить пароль» button with lock-reset icon', () => { const wrapper = factory(); const btn = wrapper.find('button'); expect(btn.exists()).toBe(true); expect(btn.text()).toContain('Сменить пароль'); expect(wrapper.find('.mdi-lock-reset').exists()).toBe(true); }); });