UNPKG

bem-js

Version:

A small jQuery library that helps to create CSS classes according to the BEM methodology.

33 lines (28 loc) 1.04 kB
describe('$.fn', function () { describe('isElement method', function () { it('should return true if the jQuery-object is an element', function () { // Arrange. setFixtures('\ <div class="product__name"></div>\ '); // Act & Assert. expect($('.product__name').isElement()).toEqual(true); }); it('should return false if the jQuery-object is not an element', function () { // Arrange. setFixtures('\ <div class="product"></div>\ '); // Act & Assert. expect($('.product').isElement()).toEqual(false); }); it('should return false if the jQuery-object does not have a CSS class', function () { // Arrange. setFixtures('\ <div id="product"></div>\ '); // Act & Assert. expect($('#product').isElement()).toEqual(false); }); }); });