Skip to content

Commit

Permalink
fix outputs and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sleidig committed Dec 23, 2024
1 parent 03ddd6e commit 0566b50
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<div
i18n
class="notification-time"
[matTooltip]="notification.created.at | date: 'short'"
[matTooltip]="notification.created?.at | date: 'short'"
>
{{ notification.created.at | notificationTime }}
{{ notification.created?.at | notificationTime }}
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
import { ComponentFixture, TestBed } from "@angular/core/testing";

import { NotificationItemComponent } from "./notification-item.component";
import { NotificationEvent } from "../model/notification-event";
import { FontAwesomeTestingModule } from "@fortawesome/angular-fontawesome/testing";
import { NoopAnimationsModule } from "@angular/platform-browser/animations";

describe("NotificationItemComponent", () => {
let component: NotificationItemComponent;
let fixture: ComponentFixture<NotificationItemComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [NotificationItemComponent],
imports: [
NotificationItemComponent,
FontAwesomeTestingModule,
NoopAnimationsModule,
],
}).compileComponents();

fixture = TestBed.createComponent(NotificationItemComponent);
component = fixture.componentInstance;

component.notification = new NotificationEvent();

fixture.detectChanges();
});

Expand Down
16 changes: 15 additions & 1 deletion src/app/features/notification/notification.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
import { ComponentFixture, TestBed } from "@angular/core/testing";

import { NotificationComponent } from "./notification.component";
import { EntityMapperService } from "../../core/entity/entity-mapper/entity-mapper.service";
import { mockEntityMapper } from "../../core/entity/entity-mapper/mock-entity-mapper-service";
import { SessionSubject } from "../../core/session/auth/session-info";
import { of } from "rxjs";
import { FontAwesomeTestingModule } from "@fortawesome/angular-fontawesome/testing";
import { NoopAnimationsModule } from "@angular/platform-browser/animations";

describe("NotificationComponent", () => {
let component: NotificationComponent;
let fixture: ComponentFixture<NotificationComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [NotificationComponent],
imports: [
NotificationComponent,
FontAwesomeTestingModule,
NoopAnimationsModule,
],
providers: [
{ provide: EntityMapperService, useValue: mockEntityMapper() },
{ provide: SessionSubject, useValue: of(null) },
],
}).compileComponents();

fixture = TestBed.createComponent(NotificationComponent);
Expand Down

0 comments on commit 0566b50

Please sign in to comment.