dimanche 26 juillet 2015

Is there is away to test HTML element value/text

I am trying to test HTML elements in angularjs with karma and jasmine by unit testing but my test gets failed 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 text of element',function() {
    expect($('#testtext')).toBe('First Angular JS App');
}); 

});

Aucun commentaire:

Enregistrer un commentaire