Skip to content

Commit

Permalink
fixes drag and drop in tests (#51806)
Browse files Browse the repository at this point in the history
  • Loading branch information
MadameSheema committed Nov 27, 2019
1 parent 7c31512 commit c790ef2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,23 @@ export const drag = (subject: JQuery<HTMLElement>) => {
clientY: subjectLocation.top,
force: true,
})
.wait(1)
.trigger('mousemove', {
button: primaryButton,
clientX: subjectLocation.left + dndSloppyClickDetectionThreshold,
clientY: subjectLocation.top,
force: true,
});
})
.wait(1);
};

/** "Drops" the subject being dragged on the specified drop target */
export const drop = (dropTarget: JQuery<HTMLElement>) => {
cy.wrap(dropTarget)
.trigger('mousemove', { button: primaryButton })
.trigger('mouseup');
.trigger('mousemove', { button: primaryButton, force: true })
.wait(1)
.trigger('mouseup', { force: true })
.wait(1);
};

/** Drags the subject being dragged on the specified drop target, but does not drop it */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ describe('Fields Browser', () => {
);
});

it.skip('adds a field to the timeline when the user drags and drops a field', () => {
it('adds a field to the timeline when the user drags and drops a field', () => {
const filterInput = 'host.geo.c';
const toggleField = 'host.geo.city_name';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('toggle column in timeline', () => {
cy.get(`[data-test-subj="timeline"] [data-test-subj="header-text-${idField}"]`).should('exist');
});

it.skip('adds the _id field to the timeline via drag and drop', () => {
it('adds the _id field to the timeline via drag and drop', () => {
populateTimeline();

toggleFirstTimelineEventDetails();
Expand Down

0 comments on commit c790ef2

Please sign in to comment.