angular - hostCompFixture.detectChanges break my test -


i test toast component have add console log display if use hostcompfixture.detectchanges have nothing test failed directy , if delete hostcompfixture.detectchanges component

this test :

 @component({   template: `     <mae-toast [toast]="toast"></mae-toast>   ` }) class testtoastcomponent {   toast: toast   severity? : severity   id?:   heading?: string   content: string   icon?: string   color?: string   actions?: actionlistitem[] }  describe('toastcomponent', () => {   beforeeach(() => {     testbed.configuretestingmodule({       declarations: [toastcomponent, testtoastcomponent],       imports: [linkmodule, routertestingmodule,browseranimationsmodule]     })     fixture = testbed.createcomponent(toastcomponent)     comp = fixture.componentinstance      hostcompfixture = testbed.createcomponent(testtoastcomponent)     hostcomp = hostcompfixture.componentinstance    })      it('should check severity property', ()=> {         hostcomp.severity = severity.success         hostcompfixture.detectchanges()         el = hostcompfixture.debugelement.query(by.css('.mae-toast__details')).nativeelement         console.log(el)         hostcompfixture.detectchanges()         expect(el.classname).tocontain('mi-check')         expect(el.classname).tocontain('success')        }) 

i don't know if test not or other problem link hostcompfixture.detectchanges

thanks !


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -