diff --git a/jest.config.js b/jest.config.js index 876e8f35..12baf1b7 100644 --- a/jest.config.js +++ b/jest.config.js @@ -8,5 +8,8 @@ module.exports = { `/node_modules/.pnpm/(?!.*\\.mjs$|${esModules.join('|')}@)`, ], modulePathIgnorePatterns: ['/dist', '/node_modules'], - testRunner: 'jest-jasmine2' + testRunner: 'jest-jasmine2', + moduleNameMapper: { + '^src/(.*)$': '/src/$1', + }, }; \ No newline at end of file diff --git a/src/app/modules/challenge/components/challenge-header/challenge-header.component.spec.ts b/src/app/modules/challenge/components/challenge-header/challenge-header.component.spec.ts index 14207934..4ef2da24 100644 --- a/src/app/modules/challenge/components/challenge-header/challenge-header.component.spec.ts +++ b/src/app/modules/challenge/components/challenge-header/challenge-header.component.spec.ts @@ -60,7 +60,7 @@ describe('ChallengeHeaderComponent', () => { it('should open restricted modal if user is not logged in', () => { spyOn(modalService, 'open').and.stub(); - component.userLoggedIn = false; + component.isLogged = true; component.clickSendButton(); expect(modalService.open).toHaveBeenCalledWith(RestrictedModalComponent, { centered: true, size: 'lg'}); diff --git a/src/app/modules/challenge/components/challenge-info/challenge-info.component.ts b/src/app/modules/challenge/components/challenge-info/challenge-info.component.ts index 4662d9c5..63deb518 100644 --- a/src/app/modules/challenge/components/challenge-info/challenge-info.component.ts +++ b/src/app/modules/challenge/components/challenge-info/challenge-info.component.ts @@ -40,7 +40,7 @@ export class ChallengeInfoComponent { solutionsDummy = [{ solutionName: "dummy1" }, { solutionName: "dummy2" }]; showStatement = true; - isLogged: boolean = true //& tiene que estar en true para que este logueado + isLogged: boolean = true //& tiene que estar en true para que este logueado (LO DEJAMOS EN TRUE PARA FORZAR EL LOGIN HASTA TENER ACCESO A AUTHSERVICE) activeId = 1; idChallenge!: string | any; diff --git a/src/app/modules/modals/modals.module.ts b/src/app/modules/modals/modals.module.ts index 6cdedffe..fed902e0 100644 --- a/src/app/modules/modals/modals.module.ts +++ b/src/app/modules/modals/modals.module.ts @@ -5,6 +5,7 @@ import { LoginModalComponent } from './login-modal/login-modal.component'; import { SendSolutionModalComponent } from './send-solution-modal/send-solution-modal.component'; import { RestrictedModalComponent } from './restricted-modal/restricted-modal.component'; import { FiltersModalComponent } from './filters-modal/filters-modal.component'; +import { SolutionService } from 'src/app/services/solution.service'; diff --git a/src/app/modules/modals/send-solution-modal/send-solution-modal.component.spec.ts b/src/app/modules/modals/send-solution-modal/send-solution-modal.component.spec.ts index ae35fcaa..5f5c2c5d 100644 --- a/src/app/modules/modals/send-solution-modal/send-solution-modal.component.spec.ts +++ b/src/app/modules/modals/send-solution-modal/send-solution-modal.component.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; - import { SendSolutionModalComponent } from './send-solution-modal.component'; +import { HttpClientModule } from '@angular/common/http'; describe('SendSolutionModalComponent', () => { let component: SendSolutionModalComponent; @@ -8,7 +8,8 @@ describe('SendSolutionModalComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - declarations: [SendSolutionModalComponent] + declarations: [SendSolutionModalComponent], + imports: [HttpClientModule], }); fixture = TestBed.createComponent(SendSolutionModalComponent); component = fixture.componentInstance; diff --git a/src/app/modules/modals/send-solution-modal/send-solution-modal.component.ts b/src/app/modules/modals/send-solution-modal/send-solution-modal.component.ts index 32bc3308..16ef807f 100644 --- a/src/app/modules/modals/send-solution-modal/send-solution-modal.component.ts +++ b/src/app/modules/modals/send-solution-modal/send-solution-modal.component.ts @@ -7,6 +7,7 @@ import { SolutionService } from 'src/app/services/solution.service'; templateUrl: './send-solution-modal.component.html', styleUrls: ['./send-solution-modal.component.scss'] }) + export class SendSolutionModalComponent { // solutionSent = false; constructor(private modalService: NgbModal, private solutionService: SolutionService) {}