Created
March 10, 2018 19:54
-
-
Save JitendraZaa/47ff446258f861f6f8f8896593d471ec to your computer and use it in GitHub Desktop.
Jasmine Test Method fo Salesforce Lightning Test Service
This file contains hidden or 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
describe("Lightning Component Testing Examples", function(){ | |
afterEach(function() { | |
// Each spec (test) renders its components into the same div, | |
// so we need to clear that div out at the end of each spec. | |
$T.clearRenderedTestComponents(); | |
}); | |
describe('c:PersonDemo', function(){ | |
it('Is Datatable Populated', function(done) { | |
var personListObj = []; | |
var p = { | |
firstName : "John", | |
lastName : "Doe", | |
age : "28", | |
eyeColor : "Green"} ; | |
personListObj.push(p); | |
var attributes = { | |
personList:personListObj | |
}; | |
$T.createComponent("c:PersonDemo", attributes, true) | |
.then(function(component) { | |
var totalRecords = component.get("v.personList"); | |
expect(totalRecords.length).toEqual(1); | |
done(); | |
}).catch(function(e) { | |
// end this spec as a failure | |
done.fail(e); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment