Durante l'esecuzione di questo test, continuo a ricevere l'errore Expected undefined to be true.
Utilizzando element.find() per classe in Angular Unit testing
it('should have the right classes', function() {
// this doesnt work
expect(element.find('.exampleClass').hasClass('ng-hide')).toBe(true);
// but this works
expect(element.find('span').hasClass('ng-hide')).toBe(true);
});
Come posso usare jqlite di trovare un elemento da id
e class
?
Non è possibile. jqLite non supporta i selettori – Phil