Merge branch 'worktree-playable-slice-0.5-first-upgrade'
# Conflicts: # apps/web/src/app/core/api/game-api.service.ts # apps/web/src/app/features/combat/combat-page/combat-page.component.html # apps/web/src/app/features/combat/combat-page/combat-page.component.scss # apps/web/src/app/features/combat/combat-page/combat-page.component.spec.ts # apps/web/src/app/features/combat/combat-page/combat-page.component.ts
This commit is contained in:
@@ -129,6 +129,14 @@
|
||||
>
|
||||
Zum Ort
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="outcome__button outcome__button--secondary"
|
||||
data-combat-to-inventory
|
||||
(click)="goToInventory()"
|
||||
>
|
||||
Inventar öffnen
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
} @else if (combat.status === 'LOST') {
|
||||
|
||||
@@ -492,6 +492,7 @@
|
||||
|
||||
.outcome__buttons {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--ar-space-3);
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@@ -294,6 +294,15 @@ describe('CombatPageComponent', () => {
|
||||
expect(router.navigate).toHaveBeenCalledWith(['/location']);
|
||||
});
|
||||
|
||||
it('navigates to /inventory from the victory screen', async () => {
|
||||
const fixture = await setup({ ...activeCombat, status: 'WON' });
|
||||
const element = fixture.nativeElement as HTMLElement;
|
||||
|
||||
element.querySelector<HTMLButtonElement>('[data-combat-to-inventory]')?.click();
|
||||
|
||||
expect(router.navigate).toHaveBeenCalledWith(['/inventory']);
|
||||
});
|
||||
|
||||
it('shows an error and retries loading the combat', async () => {
|
||||
const fixture = await setup(null);
|
||||
combatStore.error.set('Dieser Kampf wurde nicht gefunden.');
|
||||
|
||||
@@ -168,6 +168,10 @@ export class CombatPageComponent implements OnInit {
|
||||
void this.router.navigate(['/location']);
|
||||
}
|
||||
|
||||
protected goToInventory(): void {
|
||||
void this.router.navigate(['/inventory']);
|
||||
}
|
||||
|
||||
protected monsterSprite(monsterKey: string, artworkPath: string): string {
|
||||
return monsterCutoutPath(monsterKey) ?? runtimeMonsterArtworkPath(artworkPath) ?? artworkPath;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user