Skip to content

Instantly share code, notes, and snippets.

@just-boris
Created October 19, 2015 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save just-boris/178f3ab863c7a9971708 to your computer and use it in GitHub Desktop.
Save just-boris/178f3ab863c7a9971708 to your computer and use it in GitHub Desktop.
JSUnderhood
describe('tests', function() {
function createElement(html, options) {
var wrapper = $('<div></div>');
$(html || "<select></select>").appendTo(wrapper).selectize(options || {});
return wrapper;
}
beforeEach(function () {
var $element = createElement('<select>' +
'<option value="1">Foo</option>' +
'<option value="2">Bar</option>' +
'</select>');
});
it("should initialize element", function () {
expect($element.find('select')).toHaveClass('selectized');
expect($selement.find('.selectize-input')).toExist();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment