fix implicit window object reference within gl_form_spec

This commit is contained in:
Mike Greiling 2017-05-16 16:16:36 -05:00
parent fc4cabca09
commit f68a3f3f4b

View file

@ -27,7 +27,7 @@ describe('GLForm', () => {
$.prototype.off.calls.reset();
$.prototype.on.calls.reset();
$.prototype.css.calls.reset();
autosize.calls.reset();
window.autosize.calls.reset();
done();
});
});
@ -51,7 +51,7 @@ describe('GLForm', () => {
});
it('should autosize the textarea', () => {
expect(autosize).toHaveBeenCalledWith(jasmine.any(Object));
expect(window.autosize).toHaveBeenCalledWith(jasmine.any(Object));
});
it('should set the resize css property to vertical', () => {
@ -81,7 +81,7 @@ describe('GLForm', () => {
spyOn($.prototype, 'data');
spyOn($.prototype, 'outerHeight').and.returnValue(200);
spyOn(window, 'outerHeight').and.returnValue(400);
spyOn(autosize, 'destroy');
spyOn(window.autosize, 'destroy');
this.glForm.destroyAutosize();
});
@ -95,7 +95,7 @@ describe('GLForm', () => {
});
it('should call autosize destroy', () => {
expect(autosize.destroy).toHaveBeenCalledWith(this.textarea);
expect(window.autosize.destroy).toHaveBeenCalledWith(this.textarea);
});
it('should set the data-height attribute', () => {
@ -114,9 +114,9 @@ describe('GLForm', () => {
it('should return undefined if the data-height equals the outerHeight', () => {
spyOn($.prototype, 'outerHeight').and.returnValue(200);
spyOn($.prototype, 'data').and.returnValue(200);
spyOn(autosize, 'destroy');
spyOn(window.autosize, 'destroy');
expect(this.glForm.destroyAutosize()).toBeUndefined();
expect(autosize.destroy).not.toHaveBeenCalled();
expect(window.autosize.destroy).not.toHaveBeenCalled();
});
});
});