Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Salesforce Lightning Platform Enterprise Architecture

You're reading from   Salesforce Lightning Platform Enterprise Architecture Architect and deliver packaged applications that cater to enterprise business needs

Arrow left icon
Product type Paperback
Published in Nov 2019
Publisher Packt
ISBN-13 9781789956719
Length 646 pages
Edition 3rd Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Andrew Fawcett Andrew Fawcett
Author Profile Icon Andrew Fawcett
Andrew Fawcett
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Building and Publishing Your Application FREE CHAPTER 2. Leveraging Platform Features 3. Application Storage 4. Apex Execution and Separation of Concerns 5. Application Service Layer 6. Application Domain Layer 7. Application Selector Layer 8. Building User Interfaces 9. User Interfaces with Lightning Framework 10. Providing Integration and Extensibility 11. Asynchronous Processing and Big Data Volumes 12. Unit Testing 13. Source Control and Continuous Integration 14. Integrating with External Services 15. Adding AI with Einstein 16. Other Books You May Enjoy

Unit testing with Lightning Web Components

In this section, we are going to build a unit test for the Race Setup Lightning Web Component. This component has a number of dependencies that need to be mocked in order to build a successful unit test that covers the component's HTML and JavaScript code. Here is a reminder of what the component looks like:

When the user selects drivers and clicks Add Drivers, a confirmation toast message is shown:

The Race Setup component uses a lightning-table child component defined in its HTML and methods from an Apex Controller RaceSetupComponentController class defined in its JavaScript controller. Lightning Web Components unit tests focus solely on the logic directly in the Race Setup component code (raceSetup.html and raceSetup.js) and no other concerns, thus, we will focus on testing the following behaviors:

  • When the component has...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime