import 'package:test/test.dart'; import 'package:x_haven_server/core/commands/set_ally_deck_in_og_gloom_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(); }); group('SetAllyDeckInOgGloomCommand', () { test('should set allyDeckInOGGloom to false', () { SetAllyDeckInOgGloomCommand( false, gameState: getIt(), ).execute(); expect(getIt().allyDeckInOGGloom, isFalse); checkSaveState(); }); test('should set allyDeckInOGGloom to true', () { SetAllyDeckInOgGloomCommand( false, gameState: getIt(), ).execute(); SetAllyDeckInOgGloomCommand( true, gameState: getIt(), ).execute(); expect(getIt().allyDeckInOGGloom, isTrue); checkSaveState(); }); test('describe when false returns no-ally string', () { final command = SetAllyDeckInOgGloomCommand( false, gameState: getIt(), ); expect( command.describe(), 'No ally deck in 1st edition Gloomhaven campaigns', ); }); test('describe when true returns use-ally string', () { final command = SetAllyDeckInOgGloomCommand( true, gameState: getIt(), ); expect( command.describe(), 'Use Ally Deck in 1st edition Gloomhaven Campaigns', ); }); test('undo does not throw', () { final gs = getIt(); gs.action( SetAllyDeckInOgGloomCommand(true, gameState: getIt()), ); expect(() => gs.undo(), returnsNormally); }); }); }