July 2018
Beginner to intermediate
458 pages
9h 58m
English
The first test we are going to write is for testing whether the search term entered in the text box is properly two-way bound and added on the screen.
The section of the YouTube component markup code that we test is as follows, where {!v.searchTerm} is an attribute:
<Lightning:layoutItem flexibility="auto" padding="around-large" size="6"> <p aura:id="searchTermRendered"> You searched for {!v.searchTerm} </p> </Lightning:layoutItem>
The test suite for testing the two-way data binding is shown in the following code:
describe("YoutubeSearchAppTest", function(){ afterEach(function () { $T.clearRenderedTestComponents(); }); describe("A Suite that tests the youtube search component", function() ...Read now
Unlock full access