generated from bisco/codex-bootstrap
fix: allow returning from player detail to results
This commit is contained in:
@@ -71,6 +71,7 @@ describe('AppComponent', () => {
|
||||
assert.equal(component.resultCount, 2);
|
||||
assert.equal(component.averagePoints, '14.00');
|
||||
assert.equal(component.topEfficiencyPlayer?.name, 'Luca Marini');
|
||||
assert.equal(component.selectedPlayer, null);
|
||||
});
|
||||
|
||||
it('reacts to filter changes without requiring the search button', () => {
|
||||
@@ -131,4 +132,19 @@ describe('AppComponent', () => {
|
||||
|
||||
assert.equal(component.players[0].name, 'Mateo Santos');
|
||||
});
|
||||
|
||||
it('opens and closes a player profile without losing the filtered list', () => {
|
||||
const api = {
|
||||
searchPlayers: () => of({ count: samplePlayers.length, results: samplePlayers }),
|
||||
} as unknown as PlayerApiService;
|
||||
const component = new AppComponent(api);
|
||||
|
||||
component.search();
|
||||
component.selectPlayer(samplePlayers[0]);
|
||||
component.returnToResults();
|
||||
|
||||
assert.equal(component.selectedPlayer, null);
|
||||
assert.equal(component.players.length, 2);
|
||||
assert.equal(component.resultCount, 2);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user