Salesforce
PDII · Question #246
A lead developer is creating tests for a Lightning web component. The component re-renders when a property called bypassSelection changes its value. What should the developer use to test that the…
The correct answer is C. dispatchEvent (new CustomEvent('bypassSelection')). See the full explanation below for the reasoning.
Question
A lead developer is creating tests for a Lightning web component. The component re-renders when a property called bypassSelection changes its value. What should the developer use to test that the component re-renders successfully when the property changes?
Options
- AWindow.setInterval()
- BWindow.setState()
- CdispatchEvent (new CustomEvent('bypassSelection'))
- DPromise.resolve()
How the community answered
(34 responses)- A9% (3)
- B3% (1)
- C85% (29)
- D3% (1)
Community Discussion
No community discussion yet for this question.