// ignore_for_file: avoid-late-keyword import 'package:test/test.dart'; import 'package:x_haven_server/core/commands/add_character_command.dart'; import 'package:x_haven_server/core/commands/add_cs_party_card_command.dart'; import 'package:x_haven_server/core/commands/remove_cs_party_card_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(); }); late Character character; setUp(() { getIt().clearList(); AddCharacterCommand('Blinkblade', 'Frosthaven', "", 1).execute(); character = getIt().currentList.firstWhere((e) => e is Character) as Character; }); group('RemoveCSPartyCardCommand', () { test('should remove party card from character modifier deck', () { AddCSPartyCardCommand( character.id, 1, gameState: getIt(), ).execute(); final deck = character.characterState.modifierDeck; expect(deck.hasCard('party/1'), isTrue); RemoveCSPartyCardCommand( character.id, gameState: getIt(), ).execute(); expect(deck.hasCard('party/1'), isFalse); checkSaveState(); }); test('describe includes character id', () { final command = RemoveCSPartyCardCommand( character.id, gameState: getIt(), ); expect(command.describe(), '${character.id} remove party card'); }); }); }