import { renderToStaticMarkup } from 'react-dom/server';
import { describe, expect, it } from 'vitest';
import { PasswordInput } from './input';

describe('PasswordInput', () => {
  it('默认隐藏密码并提供显示密码按钮', () => {
    const html = renderToStaticMarkup(<PasswordInput autoComplete="current-password" />);

    expect(html).toContain('type="password"');
    expect(html).toContain('autoComplete="current-password"');
    expect(html).toContain('aria-label="显示密码"');
    expect(html).toContain('aria-pressed="false"');
  });
});
