import { describe, expect, it } from 'vitest';

import { wrapText } from '../index';

describe('textWrap integration wrapText', () => {
  it('SYSTEM_DEFAULT：meta 标记 SYSTEM_DEFAULT 且仍返回 lines/wrappedText', async () => {
    const res = await wrapText({
      text: 'I am so tired',
      lang: 'EN',
      context: 'APP',
      availableWidth: 1,
      maxLines: 1,
      overflowMode: 'SYSTEM_DEFAULT',
      // 不提供测量能力，逼迫走兜底
      fontSpec: null,
      measureWidthImpl: undefined,
    });

    expect(res.lines.length).toBeGreaterThan(0);
    expect(res.wrappedText.length).toBeGreaterThan(0);
    expect(res.meta?.fallback_type).toBe('SYSTEM_DEFAULT');
  });
});

