PHP Classes

File: public/asset/vendor/select2/tests/utils/data-tests.js

Recommend this page to a friend!
  Classes of fathurrahman   mnTemplate   public/asset/vendor/select2/tests/utils/data-tests.js   Download  
File: public/asset/vendor/select2/tests/utils/data-tests.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: mnTemplate
Route HTTP requests to callback functions
Author: By
Last change:
Date: 1 year ago
Size: 927 bytes
 

Contents

Class file image Download
module('Utils - RemoveData'); var $ = require('jquery'); var Utils = require('select2/utils'); test('The data-select2-id attribute is removed', function (assert) { var $element = $('<select data-select2-id="test"></select>'); Utils.RemoveData($element[0]); assert.notEqual( $element.attr('data-select2-id'), 'test', 'The internal attribute was not removed when the data was cleared' ); }); test('The internal cache for the element is cleared', function (assert) { var $element = $('<select data-select2-id="test"></select>'); Utils.__cache.test = { 'foo': 'bar' }; Utils.RemoveData($element[0]); assert.equal(Utils.__cache.test, null, 'The cache should now be empty'); }); test('Calling it on an element without data works', function (assert) { assert.expect(0); var $element = $('<select></select>'); Utils.RemoveData($element[0]); });