Force jasmine version to 2.4.1

This commit is contained in:
Josh Johnson 2016-09-04 14:11:07 +01:00
parent ca86265731
commit b95f9bac5e
3 changed files with 19 additions and 18 deletions

View file

@ -178,7 +178,7 @@ export default class Choices {
* @public * @public
*/ */
init(callback = this.config.callbackOnInit) { init(callback = this.config.callbackOnInit) {
if (this.initialised !== true) { if (this.initialised === false) {
// Set initialise flag // Set initialise flag
this.initialised = true; this.initialised = true;
@ -213,19 +213,23 @@ export default class Choices {
* @public * @public
*/ */
destroy() { destroy() {
this._removeEventListeners(); if (this.initialised === true) {
this._removeEventListeners();
this.passedElement.classList.remove(this.config.classNames.input, this.config.classNames.hiddenState); this.passedElement.classList.remove(this.config.classNames.input, this.config.classNames.hiddenState);
this.passedElement.tabIndex = ''; this.passedElement.tabIndex = '';
this.passedElement.removeAttribute('style', 'display:none;'); this.passedElement.removeAttribute('style', 'display:none;');
this.passedElement.removeAttribute('aria-hidden'); this.passedElement.removeAttribute('aria-hidden');
this.containerOuter.outerHTML = this.passedElement.outerHTML; this.containerOuter.outerHTML = this.passedElement.outerHTML;
this.passedElement = null; this.passedElement = null;
this.userConfig = null; this.userConfig = null;
this.config = null; this.config = null;
this.store = null; this.store = null;
this.initialised = false;
}
} }
/** /**

View file

@ -39,7 +39,7 @@
"eslint-plugin-import": "^1.13.0", "eslint-plugin-import": "^1.13.0",
"eslint-plugin-jsx-a11y": "^2.1.0", "eslint-plugin-jsx-a11y": "^2.1.0",
"eslint-plugin-react": "^6.1.0", "eslint-plugin-react": "^6.1.0",
"jasmine-core": "^2.4.1", "jasmine-core": "2.4.1",
"karma": "^1.1.0", "karma": "^1.1.0",
"karma-coverage": "^1.0.0", "karma-coverage": "^1.0.0",
"karma-es6-shim": "^1.0.0", "karma-es6-shim": "^1.0.0",

View file

@ -35,12 +35,9 @@ describe('Choices', function() {
}) })
it('should have a blank state', function() { it('should have a blank state', function() {
const blankState = { expect(this.choices.currentState.items.length).toEqual(0);
items: [], expect(this.choices.currentState.groups.length).toEqual(0);
groups: [], expect(this.choices.currentState.choices.length).toEqual(0);
choices: [],
};
expect(this.choices.currentState).toEqual(blankState);
}); });
it('should have config options', function() { it('should have config options', function() {