diff --git a/src/app/modules/songs/song/song.component.html b/src/app/modules/songs/song/song.component.html index c07a40a..801106f 100644 --- a/src/app/modules/songs/song/song.component.html +++ b/src/app/modules/songs/song/song.component.html @@ -47,21 +47,25 @@
{{ song.comment }}
- Löschen - Bearbeiten - - Zu Veranstaltung hinzufügen - - @for (show of privateShows$|async; track show.id) { - {{ show.date.toDate() | date: "dd.MM.yyyy" }} {{ show.showType | showType }} - - } - - - - - } + Löschen + Bearbeiten + + @if (privateShows$ | async; as privateShows) { + @if (privateShows.length > 0) { + Zu Veranstaltung hinzufügen + + @for (show of privateShows; track show.id) { + {{ show.date.toDate() | date: "dd.MM.yyyy" }} {{ show.showType | showType }} + + } + + } + } + + + + } @if (files$ | async; as files) { @if (files.length > 0) { diff --git a/src/app/modules/songs/song/song.component.spec.ts b/src/app/modules/songs/song/song.component.spec.ts index 445baa0..f9955e5 100644 --- a/src/app/modules/songs/song/song.component.spec.ts +++ b/src/app/modules/songs/song/song.component.spec.ts @@ -55,4 +55,11 @@ describe('SongComponent', () => { it('should create', () => { void expect(component).toBeTruthy(); }); + + it('should hide add-to-show when there are no private shows', () => { + const buttons = Array.from(fixture.nativeElement.querySelectorAll('app-button button')) as HTMLButtonElement[]; + const addButton = buttons.find(button => button.textContent?.includes('Zu Veranstaltung hinzufügen')); + + void expect(addButton).toBeUndefined(); + }); });