import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/material.dart';
import 'package:kuaishai2/core/localization/app_localizations.dart';

void main() {
  group('AppLocalizations', () {
    test('Chinese locale should return Chinese strings', () {
      const locale = Locale('zh', 'CN');
      final l10n = AppLocalizations(locale);

      expect(l10n.deviceName, contains('一体机'));
      expect(l10n.programs, equals('程序管理'));
      expect(l10n.run, equals('运行'));
      expect(l10n.settings, equals('系统设置'));
    });

    test('English locale should return English strings', () {
      const locale = Locale('en', 'US');
      final l10n = AppLocalizations(locale);

      expect(l10n.deviceName, contains('System'));
      expect(l10n.programs, equals('Programs'));
      expect(l10n.run, equals('Run'));
      expect(l10n.settings, equals('Settings'));
    });

    test('New translation keys should work', () {
      const locale = Locale('zh', 'CN');
      final l10n = AppLocalizations(locale);

      expect(l10n.lightOn, equals('亮'));
      expect(l10n.lightOff, equals('暗'));
      expect(l10n.enabled, equals('启用'));
      expect(l10n.disabled, equals('停用'));
      expect(l10n.stepList, equals('步骤列表'));
    });
  });
}