import { createDirectiveFactory, SpectatorDirective } from '@ngneat/spectator<% if (secondaryEntryPoint) { %>/<%= secondaryEntryPoint%><% } %>'; import { <%= classify(name)%>Directive } from './<%= dasherize(name)%>.directive'; describe('<%= classify(name)%>Directive', () => { let spectator: SpectatorDirective<<%= classify(name)%>Directive>; const createDirective = createDirectiveFactory(<%= classify(name)%>Directive); it('should change the background color', () => { spectator = createDirective(`
Testing <%= classify(name)%>Directive
`); spectator.dispatchMouseEvent(spectator.element, 'mouseover'); expect(spectator.element).toHaveStyle({ backgroundColor: 'rgba(0,0,0, 0.1)' }); spectator.dispatchMouseEvent(spectator.element, 'mouseout'); expect(spectator.element).toHaveStyle({ backgroundColor: '#fff' }); }); });