import 'package:test/test.dart'; import 'package:x_haven_server/core/commands/add_character_command.dart'; import 'package:x_haven_server/core/commands/draw_loot_card_command.dart'; import 'package:x_haven_server/core/commands/set_campaign_command.dart'; import 'package:x_haven_server/core/commands/set_loot_owner_command.dart'; import 'package:x_haven_server/core/commands/set_scenario_command.dart'; import 'package:x_haven_server/core/state/game_state.dart'; import 'package:x_haven_server/core/service_locator.dart'; import 'test_helpers.dart'; void main() { setUpAll(() async { await setUpGame(); }); setUp(() { getIt().clearList(); AddCharacterCommand('Blinkblade', 'Frosthaven', 'blinky', 1).execute(); SetCampaignCommand('Frosthaven').execute(); SetScenarioCommand( 'custom', false, gameState: getIt(), ).execute(); DrawLootCardCommand(gameState: getIt()).execute(); }); group('SetLootOwnerCommand', () { test('should set owner on the loot card', () { final lootDeck = getIt().lootDeck; final card = lootDeck.discardPileTop; expect(card.owner, isEmpty); SetLootOwnerCommand('Blinkblade', card).execute(); expect(card.owner, 'Blinkblade'); checkSaveState(); }); test('describe returns correct string', () { final lootDeck = getIt().lootDeck; final card = lootDeck.discardPileTop; final command = SetLootOwnerCommand('Blinkblade', card); expect(command.describe(), 'Set loot card owner'); }); }); }