Skip to content

Commit

Permalink
[#2803] Fix a couple of errors in the test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
aron committed Aug 6, 2012
1 parent 1624f8e commit 074a31f
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions ckan/public/base/test/spec/modules/autocomplete.spec.js
Expand Up @@ -59,6 +59,8 @@ describe('ckan.modules.AutocompleteModule()', function () {
assert.calledWith(this.select2, {
width: 'resolve',
query: this.module._onQuery,
dropdownCssClass: '',
containerCssClass: '',
formatResult: this.module.formatResult,
formatNoMatches: this.module.formatNoMatches,
formatInputTooShort: this.module.formatInputTooShort,
Expand All @@ -75,13 +77,50 @@ describe('ckan.modules.AutocompleteModule()', function () {
assert.calledWith(this.select2, {
width: 'resolve',
tags: this.module._onQuery,
dropdownCssClass: '',
containerCssClass: '',
formatResult: this.module.formatResult,
formatNoMatches: this.module.formatNoMatches,
formatInputTooShort: this.module.formatInputTooShort,
initSelection: this.module.formatInitialValue
});

it('should watch the keydown event on the select2 input');

it('should allow a custom css class to be added to the dropdown', function () {
this.module.options.dropdownClass = 'tags';
this.module.setupAutoComplete();

assert.called(this.select2);
assert.calledWith(this.select2, {
width: 'resolve',
tags: this.module._onQuery,
dropdownCssClass: 'tags',
containerCssClass: '',
formatResult: this.module.formatResult,
formatNoMatches: this.module.formatNoMatches,
formatInputTooShort: this.module.formatInputTooShort,
initSelection: this.module.formatInitialValue
});
});

it('should allow a custom css class to be added to the container', function () {
this.module.options.containerClass = 'tags';
this.module.setupAutoComplete();

assert.called(this.select2);
assert.calledWith(this.select2, {
width: 'resolve',
tags: this.module._onQuery,
dropdownCssClass: '',
containerCssClass: 'tags',
formatResult: this.module.formatResult,
formatNoMatches: this.module.formatNoMatches,
formatInputTooShort: this.module.formatInputTooShort,
initSelection: this.module.formatInitialValue
});
});

});
});

Expand Down

0 comments on commit 074a31f

Please sign in to comment.