Last active
September 22, 2017 18:04
-
-
Save yury-sannikov/81a22ac663651bc46f910e36f481842e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@testMethod('handleFieldUpdatedEvent should exit if event secondaryGroup does not match') | |
@inject('cmpSecondaryGroup', 'eventSecondaryGroup', null) | |
@testMethod('handleFieldUpdatedEvent should call updateFieldVisibility') | |
@inject('secondaryGroup', 'secondaryGroup', null) | |
handleFieldUpdatedEvent(secondaryGroup, eventSecondaryGroup, secondaryIdElements) { | |
const event = eventFactory({secondaryGroup: eventSecondaryGroup}) | |
const component = componentFactory({secondaryGroup, findMap: {value: [true, true]}}) | |
controller.handleFieldUpdatedEvent(component, event, helper); | |
if (component.get('v.secondaryGroup') !== event.getParam('secondaryGroup')) { | |
expect(component.find).not.to.have.been.called; | |
return; | |
} | |
expect(helper.updateFieldVisibility).to.have.callCount(2); | |
if (secondaryIdElements) { | |
if (Array.isArray(secondaryIdElements)) { | |
expect(helper.updateDivVisibility).to.have.callCount(secondaryIdElements.length); | |
} else { | |
expect(helper.updateDivVisibility).to.have.been.called; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment