|
7 | 7 | <link rel="import" href="../../test-fixture/test-fixture.html">
|
8 | 8 | <link rel="import" href="../../iron-test-helpers/iron-test-helpers.html">
|
9 | 9 | <link rel="import" href="../src/vaadin-dialog.html">
|
| 10 | + <link rel="import" href="../../polymer/polymer-element.html"> |
| 11 | + <link rel="import" href="../../polymer/lib/utils/html-tag.html"> |
10 | 12 | </head>
|
11 | 13 |
|
12 | 14 | <body>
|
|
58 | 60 | <template>
|
59 | 61 | <div>Draggable dialog</div>
|
60 | 62 | <div class="draggable">Draggable area</div>
|
| 63 | + <internally-draggable></internally-draggable> |
61 | 64 | <button>OK</button>
|
62 | 65 | </template>
|
63 | 66 | </vaadin-dialog>
|
|
435 | 438 | dispatchMouseEvent(target, 'mouseup', toXY, mouseButton);
|
436 | 439 | }
|
437 | 440 |
|
| 441 | + before(() => { |
| 442 | + customElements.define('internally-draggable', class extends Polymer.Element { |
| 443 | + static get template() { |
| 444 | + return Polymer.html`<div class="draggable">draggable</div>`; |
| 445 | + } |
| 446 | + }); |
| 447 | + }); |
| 448 | + |
438 | 449 | beforeEach(() => {
|
439 | 450 | dialog = fixture('draggable');
|
440 | 451 | container = dialog.$.overlay.$.resizerContainer;
|
|
465 | 476 | expect(Math.floor(draggedBounds.left)).to.be.eql(Math.floor(bounds.left + dx));
|
466 | 477 | });
|
467 | 478 |
|
| 479 | + it('should drag and move dialog if mousedown on element with [class="draggable"] in another shadow root', () => { |
| 480 | + drag(dialog.$.overlay.querySelector('internally-draggable').shadowRoot.querySelector('.draggable')); |
| 481 | + const draggedBounds = container.getBoundingClientRect(); |
| 482 | + expect(Math.floor(draggedBounds.top)).to.be.eql(Math.floor(bounds.top + dx)); |
| 483 | + expect(Math.floor(draggedBounds.left)).to.be.eql(Math.floor(bounds.left + dx)); |
| 484 | + }); |
| 485 | + |
468 | 486 | it('should drag and move dialog after resizing', () => {
|
469 | 487 | resize(container.querySelector('.s'), 0, dx);
|
470 | 488 | const bounds = container.getBoundingClientRect();
|
|
0 commit comments