I'm new to angularjs trying to test HTML elements but my test gets failed.Actually,i want to test the HTML element's value or text which it contain. can anyone suggest me how can i achieve it? here is my controllerspec:
describe('myAppCtrl', function() {
var scope, controller, httpBackend;
beforeEach(module('myApp'));
beforeEach(inject(function($rootScope, $controller, $httpBackend) {
scope = $rootScope;
controller = $controller;
httpBackend = $httpBackend;
}));
it('should show the number of items in list',function() {
expect($('#testtext')).toBe('First Angular JS App');
});
});
Aucun commentaire:
Enregistrer un commentaire