Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add order template detail links on order template widget #575

Merged
merged 1 commit into from
Feb 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"`
);
});
});