samedi 25 juillet 2015

Is there a way to test HTML element in angularjs? [Here is my app in plunkr][1] [1]: http://ift.tt/1MMoqDP

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