Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xdan committed May 24, 2021
1 parent bff9ee3 commit be3a719
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/plugins/table/table.less
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
table {
max-width: 100%;
border: none;
margin: 1em auto;

margin-top: 1em;
margin-bottom: 1em;

border-collapse: collapse;
empty-cells: show;
table-layout: fixed;
Expand Down
12 changes: 9 additions & 3 deletions test/tests/acceptance/tableTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/

describe('Tables Jodit Editor Tests', function () {
describe('Methods', function () {
it('After init container must has one element .jodit-table-resizer', function () {
Expand Down Expand Up @@ -1329,6 +1330,8 @@ describe('Tables Jodit Editor Tests', function () {
'</tbody>' +
'</table>';

editor.editor.scrollIntoView();

let td = editor.editor.querySelector('td');

simulateEvent('mousedown', td);
Expand Down Expand Up @@ -1446,10 +1449,13 @@ describe('Tables Jodit Editor Tests', function () {
'<tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td></tr>' +
'</table>';

editor.editor.scrollIntoView();

const td = editor.editor.querySelectorAll('td')[1],
box = td.getBoundingClientRect();

simulateEvent('mousemove', 1, td, function (options) {
debugger
simulateEvent('mousemove', td, function (options) {
options.clientX = box.left;
options.offsetX = 0;
options.pageX = 0;
Expand All @@ -1458,7 +1464,6 @@ describe('Tables Jodit Editor Tests', function () {

simulateEvent(
'mousedown',
1,
editor.container.querySelector('.jodit-table-resizer'),
function (options) {
options.clientX = box.left;
Expand All @@ -1467,7 +1472,7 @@ describe('Tables Jodit Editor Tests', function () {
}
);

simulateEvent('mousemove', 1, editor.ew, function (options) {
simulateEvent('mousemove', editor.ew, function (options) {
options.clientX = box.left + 500; // can move only on 5 pixels
options.pageX = 0;
options.pageY = 0;
Expand All @@ -1480,6 +1485,7 @@ describe('Tables Jodit Editor Tests', function () {
10
) < 55
).is.true;

done();
});

Expand Down

0 comments on commit be3a719

Please sign in to comment.