Skip to content

Commit

Permalink
Fixed navigating single issues [#667]
Browse files Browse the repository at this point in the history
  • Loading branch information
mcpierce committed Jun 27, 2021
1 parent 640130c commit 80b9908
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
color="primary"
[matTooltip]="'comic-book.tooltip.go-to-previous-comic' | translate"
[disabled]="!comic.previousIssueId"
(click)="onPreviousComic()"
[routerLink]="['/comics', comic.previousIssueId]"
>
<mat-icon>arrow_back</mat-icon>
</button>
Expand All @@ -17,7 +17,7 @@
[disabled]="!comic.nextIssueId"
color="primary"
[matTooltip]="'comic-book.tooltip.go-to-next-comic' | translate"
(click)="onNextComic()"
[routerLink]="['/comics', comic.nextIssueId]"
>
<mat-icon>arrow_forward</mat-icon>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,34 +178,6 @@ describe('ComicBookPageComponent', () => {
});
});

describe('going to the previous comic in a series', () => {
beforeEach(() => {
component.comic = { ...COMIC, previousIssueId: OTHER_COMIC.id };
component.onPreviousComic();
});

it('redirects the browser', () => {
expect(router.navigate).toHaveBeenCalledWith(
['library', 'comics', OTHER_COMIC.id],
{ queryParamsHandling: 'preserve' }
);
});
});

describe('going to the next comic in a series', () => {
beforeEach(() => {
component.comic = { ...COMIC, nextIssueId: OTHER_COMIC.id };
component.onNextComic();
});

it('redirects the browser', () => {
expect(router.navigate).toHaveBeenCalledWith(
['library', 'comics', OTHER_COMIC.id],
{ queryParamsHandling: 'preserve' }
);
});
});

describe('query parameter processing', () => {
const TAB = 3;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,6 @@ export class ComicBookPageComponent
this.store.dispatch(resetScraping());
}

onPreviousComic(): void {
this.logger.trace('Loading previous comic:', this.comic.previousIssueId);
this.routeToComic(this.comic.previousIssueId);
}

onNextComic(): void {
this.logger.trace('Loading next comic:', this.comic.nextIssueId);
this.routeToComic(this.comic.nextIssueId);
}

onTabChange(index: number): void {
this.logger.trace('Changing active tab:', index);
updateQueryParam(
Expand Down

0 comments on commit 80b9908

Please sign in to comment.