Salesforce Certified Platform Developer II — Question 205
A developer has created a Lightning web component that uses the getRecord wire adapter.
Which three things should the developer do in a Jest test to validate the wire method is working as expected? (Choose three.)
Answer options
- A. Use an assert statement to validate results.
- B. Import wire from lwc.
- C. Use the emit() API.
- D. Create a JSON file with mock data.
- E. Import getRecord from lightning/uiRecordApi.
Correct answer: B, C, E
Explanation
The correct actions are to import wire from lwc (B), use the emit() API to trigger events (C), and import getRecord from lightning/uiRecordApi (E) to access the wire adapter. Options A and D are not necessary for validating the wire method's functionality in this context.