diff --git a/.scannerwork/.sonar_lock b/.scannerwork/.sonar_lock new file mode 100644 index 0000000..e69de29 diff --git a/.scannerwork/report-task.txt b/.scannerwork/report-task.txt new file mode 100644 index 0000000..728c4b2 --- /dev/null +++ b/.scannerwork/report-task.txt @@ -0,0 +1,7 @@ +organization=isocra +projectKey=TableDnD +serverUrl=https://sonarcloud.io +serverVersion=7.0.0.35052 +dashboardUrl=https://sonarcloud.io/dashboard/index/TableDnD +ceTaskId=AWCoUo8vzhfPH6zNRdlG +ceTaskUrl=https://sonarcloud.io/api/ce/task?id=AWCoUo8vzhfPH6zNRdlG diff --git a/__tests__/test.jquery.tablednd.js b/__tests__/test.jquery.tablednd.js new file mode 100644 index 0000000..e90a6fe --- /dev/null +++ b/__tests__/test.jquery.tablednd.js @@ -0,0 +1,30 @@ +const $ = require('jquery') +window.jQuery = $; +const tableDnD = require('../js/jquery.tablednd'); + +beforeEach(function() { + document.body.innerHTML = + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ''; +}); + +test('Creates a TableDnD table', function() { + var $table = $('#table1'); + var table = $table.tableDnD(); + expect(table).not.toBeUndefined(); +}); + +test('Simulate drag and drop', function() { + var $table = $('#table1'); + var table = $table.tableDnD(); + var $row = $('#row1'); + TestUtils.Simulate.dragStart($row, {dataTransfer: null}); + +}); diff --git a/package.json b/package.json index b63f7bc..ace4bba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tablednd", - "version": "1.0.2", + "version": "1.0.3", "description": "JQuery plugin for dragging and droping rows in a table", "main": "Gruntfile.js", "dependencies": {}, diff --git a/test/test.jquery.tablednd.js b/test/test.jquery.tablednd.js new file mode 100644 index 0000000..e69de29
Col1
Row1
Row2
Row3