소스 검색

Added test to make sure the options are generated

Kevin Brown 10 년 전
부모
커밋
8158e151ff
8개의 변경된 파일12개의 추가작업 그리고 20개의 파일을 삭제
  1. 0 4
      dist/js/select2.amd.full.js
  2. 0 4
      dist/js/select2.amd.js
  3. 0 4
      dist/js/select2.full.js
  4. 0 0
      dist/js/select2.full.min.js
  5. 0 4
      dist/js/select2.js
  6. 0 0
      dist/js/select2.min.js
  7. 0 4
      src/js/select2/data/array.js
  8. 12 0
      tests/data/array-tests.js

+ 0 - 4
dist/js/select2.amd.full.js

@@ -1189,12 +1189,8 @@ define('select2/data/array',[
       var item = data[d];
       item.id = item.id.toString();
 
-      console.log(existingIds, item.id, existingIds.indexOf(item.id));
-
       // Skip items which were pre-loaded, only merge the data
       if (existingIds.indexOf(item.id) >= 0) {
-        console.log(item.id);
-
         var $existingOption = $existing.filter(onlyItem(item));
 
         var existingData = this.item($existingOption);

+ 0 - 4
dist/js/select2.amd.js

@@ -1189,12 +1189,8 @@ define('select2/data/array',[
       var item = data[d];
       item.id = item.id.toString();
 
-      console.log(existingIds, item.id, existingIds.indexOf(item.id));
-
       // Skip items which were pre-loaded, only merge the data
       if (existingIds.indexOf(item.id) >= 0) {
-        console.log(item.id);
-
         var $existingOption = $existing.filter(onlyItem(item));
 
         var existingData = this.item($existingOption);

+ 0 - 4
dist/js/select2.full.js

@@ -10724,12 +10724,8 @@ define('select2/data/array',[
       var item = data[d];
       item.id = item.id.toString();
 
-      console.log(existingIds, item.id, existingIds.indexOf(item.id));
-
       // Skip items which were pre-loaded, only merge the data
       if (existingIds.indexOf(item.id) >= 0) {
-        console.log(item.id);
-
         var $existingOption = $existing.filter(onlyItem(item));
 
         var existingData = this.item($existingOption);

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/js/select2.full.min.js


+ 0 - 4
dist/js/select2.js

@@ -1617,12 +1617,8 @@ define('select2/data/array',[
       var item = data[d];
       item.id = item.id.toString();
 
-      console.log(existingIds, item.id, existingIds.indexOf(item.id));
-
       // Skip items which were pre-loaded, only merge the data
       if (existingIds.indexOf(item.id) >= 0) {
-        console.log(item.id);
-
         var $existingOption = $existing.filter(onlyItem(item));
 
         var existingData = this.item($existingOption);

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/js/select2.min.js


+ 0 - 4
src/js/select2/data/array.js

@@ -32,12 +32,8 @@ define([
       var item = data[d];
       item.id = item.id.toString();
 
-      console.log(existingIds, item.id, existingIds.indexOf(item.id));
-
       // Skip items which were pre-loaded, only merge the data
       if (existingIds.indexOf(item.id) >= 0) {
-        console.log(item.id);
-
         var $existingOption = $existing.filter(onlyItem(item));
 
         var existingData = this.item($existingOption);

+ 12 - 0
tests/data/array-tests.js

@@ -174,3 +174,15 @@ test('multiple adds to the old value', function (assert) {
 
   assert.deepEqual($select.val(), ['3', 'default']);
 });
+
+test('option tags are automatically generated', function (assert) {
+  var $select = $('#qunit-fixture .single');
+
+  var data = new ArrayData($select, options);
+
+  assert.equal(
+    $select.find('option').length,
+    3,
+    'An <option> element should be created for each object'
+  );
+});

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.