Commit b643e0c7 authored by Johan Vervloet's avatar Johan Vervloet

Bugfix and test adding player during game, #136.

Closes #136
parent 33898c05
Pipeline #128287295 failed with stages
in 5 minutes and 36 seconds
......@@ -12,6 +12,7 @@
- Tried to bring more consistency to the API, #106, #132.
- Also show player names at bottom of table, #134.
- Bugfix upding player drop downs after adding player, #136.
## [0.5.1] - 2020-02-29
......
......@@ -521,7 +521,8 @@
)
// FIXME: This will not work if we ever go async.
.then(this.refreshPlayers)
.then(this.refreshPermissions);
// Also refresh sheet, because sheet determines playing players.
.then(this.refreshSheetAndPermissions);
this.newPlayerName = '';
this.newPlayerUuid = this.uuidv4();
......
......@@ -28,6 +28,7 @@ final class TestIds
const TEST_TABLE_15 = 'CFE662CB-544C-4C38-8ADB-0C2944146D03';
const TEST_TABLE_16 = 'B1ABFD91-2143-491A-8B80-41C857B88895';
const TEST_TABLE_17 = 'A489A432-A898-498A-B1B5-6A3CFE4280A0';
const TEST_TABLE_18 = '0CA72D91-4CC6-4188-B90B-9F34B1AD5916';
const PLAYER_SECRETARIS = '87bdf1ee-5102-4c19-9975-2cb0a6b1d6f8';
const PLAYER_PENNINGMEESTER = '5d46004d-eb1b-41a6-af37-9a92c0acde2a';
......
......@@ -110,4 +110,11 @@ final class TestTable
TestIds::TEST_TABLE_17
);
}
public static function table18(): TableIdentifier
{
return TableIdentifier::fromString(
TestIds::TEST_TABLE_18
);
}
}
......@@ -296,6 +296,8 @@ final class TestDataCommand extends Command
)
);
$this->testTableBuilder->buildTableWithFourPlayersReadyToPlay(TestTable::table18());
$io->success('Test data loaded.');
}
}
......@@ -41,4 +41,20 @@ final class AddPlayerCest
$i->waitForText('freddy');
$i->see('freddy', 'th');
}
public function checkPlayerDropDownsUpdateAfterAddingAPlayer(AcceptanceTester $i): void
{
$i->amOnPage('/en/table/'.TestIds::TEST_TABLE_18);
$i->waitForElement('//input[@name="new_player"]');
$i->fillField('new_player', 'freddy');
$i->click('Add');
$i->selectOption('game_to_log', 'alone');
$i->waitForElement('//select/option[normalize-space(text())="freddy"]');
$i->seeElement('//select/option[normalize-space(text())="freddy"]');
// DTL is dealer, can't log alone.
$i->dontSeeElement('//select[@name="announcing_player_1"]/option[@value="'.TestIds::PLAYER_DTL.'"]');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment