import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pluriwave/tema/pluriwave_theme.dart';
import 'package:pluriwave/tema/pluriwave_tokens.dart';
import 'package:pluriwave/widgets/pluri_glass_surface.dart';
import 'package:pluriwave/widgets/pluri_icon.dart';
import 'package:pluriwave/widgets/pluri_wave_scaffold.dart';

void main() {
  test('PluriWaveTokens.dark mantiene valores base esperados', () {
    expect(PluriWaveTokens.dark.deepViolet, const Color(0xFF24123D));
    expect(PluriWaveTokens.dark.radiusMd, 16);
    expect(PluriWaveTokens.dark.spacingMd, 16);
  });

  testWidgets('PluriIcon expone semantics label', (tester) async {
    await tester.pumpWidget(
      MaterialApp(
        theme: PluriWaveTheme.dark(),
        home: const Scaffold(
          body: PluriIcon(
            glyph: PluriIconGlyph.search,
            variant: PluriIconVariant.activeGlow,
            semanticLabel: 'Buscar emisoras',
          ),
        ),
      ),
    );

    expect(find.bySemanticsLabel('Buscar emisoras'), findsOneWidget);
  });

  testWidgets('PluriGlassSurface y PluriWaveScaffold se instancian', (tester) async {
    await tester.pumpWidget(
      MaterialApp(
        theme: PluriWaveTheme.dark(),
        home: const PluriWaveScaffold(
          body: Center(
            child: PluriGlassSurface(
              child: Text('ok'),
            ),
          ),
        ),
      ),
    );

    expect(find.byType(PluriWaveScaffold), findsOneWidget);
    expect(find.byType(PluriGlassSurface), findsOneWidget);
    expect(find.text('ok'), findsOneWidget);
  });
}
