Skip to content

Commit

Permalink
fix: dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
SGrueber committed Sep 25, 2024
1 parent b2bd646 commit 2725332
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,31 +1,19 @@
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';

import { HttpError } from 'ish-core/models/http-error/http-error.model';
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';

import { WishlistsFacade } from '../../facades/wishlists.facade';
import { Wishlist, WishlistItem } from '../../models/wishlist/wishlist.model';
import { WishlistItem } from '../../models/wishlist/wishlist.model';

@Component({
selector: 'ish-wishlist-page',
templateUrl: './shared-wishlist-page.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SharedWishlistPageComponent implements OnInit {
wishlistId: string;
owner: string;
secureCode: string;
wishlist$: Observable<Wishlist>;
wishlistError$: Observable<HttpError>;
wishlistLoading$: Observable<boolean>;

constructor(private wishlistsFacade: WishlistsFacade) {}
export class SharedWishlistPageComponent {
private readonly wishlistsFacade = inject(WishlistsFacade);

ngOnInit(): void {
this.wishlist$ = this.wishlistsFacade.currentWishlist$;
this.wishlistError$ = this.wishlistsFacade.wishlistError$;
this.wishlistLoading$ = this.wishlistsFacade.wishlistLoading$;
}
wishlist$ = this.wishlistsFacade.currentWishlist$;
wishlistError$ = this.wishlistsFacade.wishlistError$;
wishlistLoading$ = this.wishlistsFacade.wishlistLoading$;

trackByFn(_: number, item: WishlistItem) {
return item.id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ describe('Wishlist Sharing Dialog Component', () => {
const [arg] = capture(emitter.emit).last();
expect(arg).toEqual({ recipients: recipientEmails, message: personalMessage });
expect(component.wishListForm.valid).toBeTrue();
expect(component.submitted).toBeFalse();
});

it('should not emit wishlist sharing data when form is submitted and invalid', () => {
Expand All @@ -50,6 +49,5 @@ describe('Wishlist Sharing Dialog Component', () => {

verify(emitter.emit(anything())).never();
expect(component.wishListForm.invalid).toBeTrue();
expect(component.submitted).toBeTrue();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class WishlistSharingDialogComponent implements OnInit {

wishListForm = new FormGroup({});
fields: FormlyFieldConfig[];
submitted = false;
private submitted = false;

/**
* A reference to the current modal.
Expand Down

0 comments on commit 2725332

Please sign in to comment.