import 'package:flutter_test/flutter_test.dart';
import 'package:lba/res/colors.dart';
import 'package:lba/utils/theme_manager.dart';
import 'package:lba/utils/sharedPreferencesKey.dart';

void main() {
  group('Dark Mode Tests', () {
    late ThemeManager themeManager;

    setUp(() {
      themeManager = ThemeManager();
    });

    test('ThemeManager should initialize with default light theme', () {
      expect(themeManager.isDarkMode, false);
    });

    test('AppColors should switch colors based on dark mode setting', () {
      // Test light mode colors
      AppColors.setDarkMode(false);
      expect(AppColors.isDarkMode, false);
      expect(AppColors.scaffoldBackground, LightAppColors.scaffoldBackground);
      expect(AppColors.textPrimary, LightAppColors.textPrimary);
      expect(AppColors.primary, LightAppColors.primary);

      // Test dark mode colors
      AppColors.setDarkMode(true);
      expect(AppColors.isDarkMode, true);
      expect(AppColors.scaffoldBackground, DarkAppColors.scaffoldBackground);
      expect(AppColors.textPrimary, DarkAppColors.textPrimary);
      expect(AppColors.primary, DarkAppColors.primary);
    });

    test('SharedPreferencesKey should contain isDarkMode key', () {
      expect(SharedPreferencesKey.isDarkMode, 'isDarkMode');
    });

    test('ThemeManager should provide correct themes', () {
      expect(themeManager.lightTheme, isNotNull);
      expect(themeManager.darkTheme, isNotNull);
      expect(themeManager.currentTheme, isNotNull);
    });

    test('Light and Dark colors should be different', () {
      expect(LightAppColors.scaffoldBackground, isNot(equals(DarkAppColors.scaffoldBackground)));
      expect(LightAppColors.textPrimary, isNot(equals(DarkAppColors.textPrimary)));
      expect(LightAppColors.cardBackground, isNot(equals(DarkAppColors.cardBackground)));
      expect(LightAppColors.divider, isNot(equals(DarkAppColors.divider)));
    });
  });
}