Skip to content

Commit

Permalink
fix blinking tests (connected with #2271) (#2299)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKamaev authored and AlexanderMoskovkin committed Apr 11, 2018
1 parent f773c21 commit ba7fd28
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
23 changes: 13 additions & 10 deletions test/functional/fixtures/regression/gh-2271/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,28 @@
function log (eventName, target, relatedTarget) {
var logger = document.getElementById('logger');

logger.innerHTML += eventName + ' ' + target.id + ' ' + (relatedTarget ? relatedTarget.id : 'none') + '<br/>';
logger.innerHTML += eventName + ' ' + target.id + ' ' + (relatedTarget ? relatedTarget.id : 'none') + ' <br/>';
}
</script>
<style>
.droptarget {
float: left;
width: 100px;
height: 35px;
padding: 10px;
p {
width: 80px;
padding: 3px;
border: 1px solid #aaaaaa;
}

#dropTarget {
width: 400px;
height: 400px;
border: 1px solid black;
}

</style>
</head>
<body id="body">
<div id="dropTarget1" class="droptarget" ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
<p id='dragElement' draggable="true">Drag me!</p>
<div id="dropTarget" ondragenter="dragEnter(event)" ondragleave="dragLeave(event)">
<p id='dragElement' draggable="true">Drag me!</p>
</div>
<div id="dropTarget2" class="droptarget" ondragenter="dragEnter(event)" ondragleave="dragLeave(event)"></div>
<div style="clear:both"/>
<div id="logger"></div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ fixture `GH-2271 - Drag events should contain relatedTarget property`
const logger = Selector('#logger');

test('Drag one element to another', async t => {
await t.setTestSpeed(0.05);
await t.dragToElement('#dragElement', '#dropTarget2');
await t.expect(logger.textContent).contains('dragenter dragElement body');
await t.expect(logger.textContent).contains('dragenter dropTarget1 dragElement');
await t.expect(logger.textContent).contains('dragleave dragElement dropTarget1');
await t.expect(logger.textContent).contains('dragenter dropTarget2 dropTarget1');
await t.expect(logger.textContent).contains('dragleave dropTarget1 dropTarget2');
await t.setTestSpeed(0.01);
await t.dragToElement('#dragElement', '#dropTarget');
await t.expect(logger.textContent).contains('dragenter dropTarget dragElement');
await t.expect(logger.textContent).contains('dragleave dragElement dropTarget');
});

0 comments on commit ba7fd28

Please sign in to comment.