From 1c6868e7766080be293f6921a988c90e67b0da13 Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:09:42 +0200 Subject: [PATCH] Formatting profile.service and profile.service.spec --- src/app/shared/services/profile/profile.service.spec.ts | 9 ++++++--- src/app/shared/services/profile/profile.service.ts | 2 -- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/app/shared/services/profile/profile.service.spec.ts b/src/app/shared/services/profile/profile.service.spec.ts index e5054a1cc..6ec170777 100644 --- a/src/app/shared/services/profile/profile.service.spec.ts +++ b/src/app/shared/services/profile/profile.service.spec.ts @@ -1,16 +1,16 @@ -import { RecordVO } from './../../../models/record-vo'; /* @format */ import { FolderPickerService } from '@core/services/folder-picker/folder-picker.service'; import { ArchiveVO, FolderVO } from '@models/index'; import { SharedModule } from '@shared/shared.module'; import { Shallow } from 'shallow-render'; +import { ProfileItemVOData } from '@models/profile-item-vo'; +import { RecordVO } from '../../../models/record-vo'; +import { ArchiveResponse } from '../api/archive.repo'; import { AccountService } from '../account/account.service'; import { ApiService } from '../api/api.service'; import { MessageService } from '../message/message.service'; import { PrConstantsService } from '../pr-constants/pr-constants.service'; import { ProfileService } from './profile.service'; -import { ProfileItemVOData } from '@models/profile-item-vo'; -import { ArchiveResponse } from '../api/archive.repo'; const PROFILE_TEMPLATE = require('../../../../../constants/profile_template.json'); @@ -127,6 +127,7 @@ describe('ProfileService', () => { (instance as any).profileItemDictionary = mockDictionary; const progress = instance.calculateProfileProgress(); + expect(progress).toBe(0.8); }); @@ -182,6 +183,7 @@ describe('ProfileService', () => { (instance as any).profileItemDictionary = mockDictionary; const progress = instance.calculateProfileProgress(); + expect(progress).toBe(1); }); @@ -191,6 +193,7 @@ describe('ProfileService', () => { (instance as any).profileItemDictionary = mockDictionary; const progress = instance.calculateProfileProgress(); + expect(progress).toBe(0); }); }); diff --git a/src/app/shared/services/profile/profile.service.ts b/src/app/shared/services/profile/profile.service.ts index 14125c4fd..1cc2777c2 100644 --- a/src/app/shared/services/profile/profile.service.ts +++ b/src/app/shared/services/profile/profile.service.ts @@ -408,8 +408,6 @@ export class ProfileService { const cols = CHECKLIST[fieldNameShort]; totalEntries += cols.length; - console.log(this.profileItemDictionary); - const itemToCheck = this.profileItemDictionary[fieldNameShort]?.[0]; if (itemToCheck) { for (const col of cols) {