From 35811a15ffbe4e7eb1282bcbb12dbf7ea83a6bbc Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Sun, 7 Apr 2024 09:07:30 +0300 Subject: [PATCH] Add a test. Disable/hide the animated/graphic solution display if the game-variant rules do not match 8cols+4reserves freecell --- fc-solve/site/wml/src/ts/tests/fcs-core.ts | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/fc-solve/site/wml/src/ts/tests/fcs-core.ts b/fc-solve/site/wml/src/ts/tests/fcs-core.ts index 0168c1d0c..191a02096 100644 --- a/fc-solve/site/wml/src/ts/tests/fcs-core.ts +++ b/fc-solve/site/wml/src/ts/tests/fcs-core.ts @@ -431,6 +431,8 @@ function my_func(qunit: QUnit, _my_mod, my_callback: () => void) { }, ); + const FCS_ES_FILLED_BY_KINGS_ONLY: number = 1; + qunit.test("FC_Solve user_get_empty_stacks_filled_by #1", (assert) => { assert.expect(1); @@ -450,6 +452,30 @@ function my_func(qunit: QUnit, _my_mod, my_callback: () => void) { ); }); + qunit.test( + "FC_Solve user_get_empty_stacks_filled_by after CLI flag", + (assert) => { + assert.expect(1); + + const instance: w.FC_Solve = new FC_Solve({ + module_wrapper, + cmd_line_preset: "default", + dir_base: "fcs4", + set_status_callback: () => { + return; + }, + string_params: "--empty-stacks-filled-by kings", + }); + + // TEST + assert.equal( + instance.get_empty_stacks_filled_by(), + FCS_ES_FILLED_BY_KINGS_ONLY, + "get_empty_stacks_filled_by() returns the modified value after command line.", + ); + }, + ); + qunit.test("FC_Solve deal_ms_fc_board", (assert) => { assert.expect(2);