import 'package:flutter_test/flutter_test.dart';

import 'package:minstrel/theme/theme_extension.dart';
import 'package:minstrel/theme/tokens.dart';

void main() {
  test('FabledSwordTheme.dark uses dark surface tokens', () {
    final fs = FabledSwordTheme.dark();
    expect(fs.obsidian, FabledSwordDarkTokens.obsidian);
    expect(fs.iron, FabledSwordDarkTokens.iron);
    expect(fs.parchment, FabledSwordDarkTokens.parchment);
  });

  test('FabledSwordTheme.light uses light surface tokens', () {
    final fs = FabledSwordTheme.light();
    expect(fs.obsidian, FabledSwordLightTokens.obsidian);
    expect(fs.iron, FabledSwordLightTokens.iron);
    expect(fs.parchment, FabledSwordLightTokens.parchment);
  });

  test('flat tokens (accent, moss, etc.) are shared between factories', () {
    final dark = FabledSwordTheme.dark();
    final light = FabledSwordTheme.light();
    expect(dark.accent, light.accent);
    expect(dark.moss, light.moss);
    expect(dark.bronze, light.bronze);
    expect(dark.oxblood, light.oxblood);
    expect(dark.warning, light.warning);
    expect(dark.error, light.error);
    expect(dark.info, light.info);
  });

  test('fromTokens() back-compat alias returns the dark theme', () {
    final alias = FabledSwordTheme.fromTokens();
    final dark = FabledSwordTheme.dark();
    expect(alias.obsidian, dark.obsidian);
    expect(alias.parchment, dark.parchment);
  });
}
