1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Need to update the mock data in angular test

Discussão em 'Angular' iniciado por Vishnu, Junho 13, 2025.

  1. Vishnu

    Vishnu Guest

    dataTeamService = jasmine.createSpyObj('DataTeamService',['setDataGroup'],{
    selectValGroup: of({
    id : 1,
    accessData : false

    })
    });


    it('shoud remove valData when accessData is false',()=>{
    fixture.detectChanges();
    expect(component.tabs). toEqual([{url: 'view', label : 'Value Management'}])
    })




    it('shoud add valData when accessData is true',()=>{

    fixture.detectChanges();

    expect(component.tabs). toEqual([{url: 'view', label : 'Value Management'}],[{url: 'valData', label : 'Value Contact'}])

    })


    First test is getting passed as accessData value is false

    But second test is getting failed as it accessData is false still..need to update that for the second test , I tried copy entire mock and paste to second test case it doesn't pass

    I tried copy entire mock data nd paste inside second test, and selectValGroup is throw error as its readable only not able to update

    Continue reading...

Compartilhe esta Página