Skip to content

Commit

Permalink
Testing modal send solution
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenaPonsico committed Nov 15, 2023
1 parent 8906c6d commit aef2990
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ module.exports = {
`<rootDir>/node_modules/.pnpm/(?!.*\\.mjs$|${esModules.join('|')}@)`,
],
modulePathIgnorePatterns: ['<rootDir>/dist', '<rootDir>/node_modules'],
testRunner: 'jest-jasmine2'
testRunner: 'jest-jasmine2',
moduleNameMapper: {
'^src/(.*)$': '<rootDir>/src/$1',
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -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'});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/app/modules/modals/modals.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';



Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
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;
let fixture: ComponentFixture<SendSolutionModalComponent>;

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [SendSolutionModalComponent]
declarations: [SendSolutionModalComponent],
imports: [HttpClientModule],
});
fixture = TestBed.createComponent(SendSolutionModalComponent);
component = fixture.componentInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down

0 comments on commit aef2990

Please sign in to comment.