Skip to content

Instantly share code, notes, and snippets.

@jhuska
Created November 7, 2013 11:58
Show Gist options
  • Save jhuska/7353472 to your computer and use it in GitHub Desktop.
Save jhuska/7353472 to your computer and use it in GitHub Desktop.
function test(fixture, element) {
// given
// var changeCallback = jasmine.createSpy('changeCallback');
var options = {
disabled: true,
// change: changeCallback
};
// when
element.pickList(options);
// then
var listClassAttr = element.attr('class');
var sourceClassAttr = element.find('.source').attr('class');
var targetClassAttr = element.find('.target').attr('class');
var buttonsClasses = element.find('.btn');
expect(listClassAttr).toContain('disabled');
expect(sourceClassAttr).toContain('disabled');
expect(targetClassAttr).toContain('disabled');
buttonsClasses.each(function (index) {
expect(this.attr('disabled')).toEqual(true);
});
debugger;
element.pickList('option', 'disabled', 'false');
}
@jstefek
Copy link

jstefek commented Nov 7, 2013

@jhuska

this will not work? line 23

expect( $(this).attr('disabled')).toEqual(true);

this >>> $(this)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment