Skip to content

Commit

Permalink
feat: add order template detail links on order template widget (#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
SGrueber authored Feb 26, 2021
1 parent d850ee6 commit 8112321
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<ng-container *ngIf="orderTemplates$ | async as orderTemplates; else emptyList">
<ng-container *ngIf="orderTemplates.length; else emptyList">
<div *ngFor="let orderTemplate of orderTemplates" class="mb-2">
{{ orderTemplate.title }}
<a [routerLink]="['/account/order-templates/', orderTemplate.id]" class="text-decoration-none">{{
orderTemplate.title
}}</a>
<a *ngIf="orderTemplate.items?.length" class="align-top float-right">
<ish-product-add-to-basket
ishProductContext
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { TranslateModule } from '@ngx-translate/core';
import { MockComponent, MockDirective } from 'ng-mocks';
import { of } from 'rxjs';
Expand Down Expand Up @@ -30,7 +31,7 @@ describe('Order Template Widget Component', () => {
when(orderTemplatesFacade.orderTemplates$).thenReturn(of(orderTemplates));

await TestBed.configureTestingModule({
imports: [TranslateModule.forRoot()],
imports: [RouterTestingModule, TranslateModule.forRoot()],
declarations: [
MockComponent(InfoBoxComponent),
MockComponent(LoadingComponent),
Expand Down Expand Up @@ -62,8 +63,8 @@ describe('Order Template Widget Component', () => {

it('should render order template list after creation', () => {
fixture.detectChanges();
expect(element.querySelector('.loading-container').textContent.trim()).toMatchInlineSnapshot(
`"order template order template 2"`
expect(element.querySelector('.loading-container').textContent).toMatchInlineSnapshot(
`"order templateorder template 2"`
);
});
});

0 comments on commit 8112321

Please sign in to comment.