Skip to content

Commit

Permalink
Fixed linting and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
raarielgrace committed Oct 11, 2024
1 parent e553176 commit 00b7f4d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
8 changes: 4 additions & 4 deletions bcmi/src/app/services/content-directive.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Directive, ElementRef, Input, Renderer2, ViewContainerRef } from "@angular/core";
import { Directive, ElementRef, Input, Renderer2, ViewContainerRef, AfterViewInit } from "@angular/core";
import { DynamicLinkComponent } from "@app/shared/dynamic-link";

@Directive({
selector: "[content]",
selector: "[appContent]",
})

export class ContentDirective {
export class ContentDirective implements AfterViewInit {
@Input()
appStyle: boolean = true;
appStyle = true;
constructor(
private ref: ElementRef,
private viewContainerRef: ViewContainerRef,
Expand Down
13 changes: 11 additions & 2 deletions bcmi/src/app/static-pages/page/page.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { SafeHtmlPipe } from '@pipes/safe-html.pipe';

import { PageComponent } from './page.component';
import { ActivatedRoute } from '@angular/router';
Expand All @@ -15,12 +16,20 @@ describe('PageComponent', () => {
const pageData = new Page();
pageData.Title = "Test";

const fakeActivatedRoute = {data: of({pageData: [pageData]}) };
const fakeActivatedRoute = {
data: of({pageData: [pageData]}),
fragment: of(null),
snapshot: {
routeConfig: {
path: '',
},
},
};

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
providers: [{provide: ActivatedRoute, useValue: fakeActivatedRoute}],
declarations: [PageComponent],
declarations: [PageComponent, SafeHtmlPipe],
imports: [CommonModule]
})
.compileComponents();
Expand Down
2 changes: 1 addition & 1 deletion bcmi/src/app/static-pages/page/page.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { afterRender, Component, OnInit, ViewEncapsulation } from '@angular/core';
import { ActivatedRoute, RouterLink, RouterModule } from '@angular/router';
import { ActivatedRoute } from '@angular/router';
import { Page } from '../../models/content/page';

@Component({
Expand Down

0 comments on commit 00b7f4d

Please sign in to comment.