From 63d1a78d18d915abdf708bff786724ce59e47dcd Mon Sep 17 00:00:00 2001
From: Tifenn Guillas <tifenn.guillas@gmail.com>
Date: Wed, 29 Sep 2021 09:37:36 +0200
Subject: [PATCH] Tests with DOM => DONE

---
 client/src/app/portal/containers/portal-home.component.spec.ts | 2 ++
 client/src/app/portal/containers/portal-home.component.ts      | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/client/src/app/portal/containers/portal-home.component.spec.ts b/client/src/app/portal/containers/portal-home.component.spec.ts
index 18f1e20c..e7e405cb 100644
--- a/client/src/app/portal/containers/portal-home.component.spec.ts
+++ b/client/src/app/portal/containers/portal-home.component.spec.ts
@@ -47,6 +47,7 @@ describe('PortalHomeComponent', () => {
         fixture = TestBed.createComponent(PortalHomeComponent);
         component = fixture.componentInstance;
         store = TestBed.inject(MockStore);
+        document.body.innerHTML = '<link id="favicon" href="">';
     }));
 
     it('should create the component', () => {
@@ -61,6 +62,7 @@ describe('PortalHomeComponent', () => {
             { label: 'Admin', icon: 'fas fa-tools', routerLink: '/admin' }
         ];
         expect(component.links).toEqual(expected);
+        expect(component.favIcon.href).toEqual('http://localhost/favicon.ico');
     });
 
     it('should execute ngOnInit lifecycle and add admin link depending on user rights', () => {
diff --git a/client/src/app/portal/containers/portal-home.component.ts b/client/src/app/portal/containers/portal-home.component.ts
index 62f20635..5a7e3ae9 100644
--- a/client/src/app/portal/containers/portal-home.component.ts
+++ b/client/src/app/portal/containers/portal-home.component.ts
@@ -47,7 +47,7 @@ export class PortalHomeComponent implements OnInit, OnDestroy {
     }
 
     ngOnInit() {
-        // this.favIcon.href = 'favicon.ico';
+        this.favIcon.href = 'favicon.ico';
         const adminLink = { label: 'Admin', icon: 'fas fa-tools', routerLink: '/admin' };
         if (!this.config.authenticationEnabled) {
             this.links.push(adminLink);
-- 
GitLab