import 'package:flutter_test/flutter_test.dart';
import 'package:game_test/game/data/item_table.dart';
import 'package:game_test/game/enums.dart';

void main() {
  TestWidgetsFlutterBinding.ensureInitialized();

  test('ItemTable loads rarity and tier correctly', () async {
    await ItemTable.load();

    // Check Rusty Dagger (Common, Tier 1)
    final rustyDagger = ItemTable.get('rusty_dagger');
    expect(rustyDagger, isNotNull);
    expect(rustyDagger!.rarity, equals(ItemRarity.magic));
    expect(rustyDagger.tier, equals(ItemTier.tier1));

    // Check Sunderer Axe (Epic, Tier 3)
    final sundererAxe = ItemTable.get('sunderer_axe');
    expect(sundererAxe, isNotNull);
    expect(sundererAxe!.rarity, equals(ItemRarity.legendary));
    expect(sundererAxe.tier, equals(ItemTier.tier3));

    // Check Lucky Charm (Legendary, Tier 3)
    final luckyCharm = ItemTable.get('lucky_charm');
    expect(luckyCharm, isNotNull);
    expect(luckyCharm!.rarity, equals(ItemRarity.unique));
    expect(luckyCharm.tier, equals(ItemTier.tier3));
  });
}
