import { describe, it, expect } from 'vitest';
import ja from '../../i18n/locales/ja/chat.json';
import en from '../../i18n/locales/en/chat.json';

// Pure JSON parity check for the rotating-tips strings consumed by
// RotatingTips.tsx. The component itself is DOM + timer based and isn't
// exercised here; this guards the data contract (chat.tips.items) instead.
describe('chat tips (RotatingTips data)', () => {
  it('ja and en both define a non-empty tips.items array', () => {
    expect(Array.isArray(ja.tips?.items)).toBe(true);
    expect(Array.isArray(en.tips?.items)).toBe(true);
    expect(ja.tips.items.length).toBeGreaterThan(0);
    expect(en.tips.items.length).toBeGreaterThan(0);
  });

  it('ja and en have the same number of tips (no locale drift)', () => {
    expect(ja.tips.items.length).toBe(en.tips.items.length);
  });

  it('every tip is a non-empty string', () => {
    for (const list of [ja.tips.items, en.tips.items]) {
      for (const tip of list) {
        expect(typeof tip).toBe('string');
        expect(tip.trim().length).toBeGreaterThan(0);
      }
    }
  });

  it('defines a tips.label in both locales', () => {
    expect(typeof ja.tips.label).toBe('string');
    expect(typeof en.tips.label).toBe('string');
  });
});
