Skip to content

Commit

Permalink
Merge pull request #1 from filipkis/fix-46
Browse files Browse the repository at this point in the history
  • Loading branch information
filipkis authored Mar 16, 2019
2 parents f63b6c0 + 520c69f commit a670535
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions angular-legacy-sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
watchers = null;
sortable = null;
nextSibling = null;
removed = null;
}


Expand All @@ -169,6 +170,7 @@
onEnd: function (/**Event*/evt) {
_emitEvent(evt, removed);
scope.$apply();
removed = null;
},
onAdd: function (/**Event*/evt) {
_sync(evt);
Expand Down
18 changes: 18 additions & 0 deletions e2e/nested-drag-drop.e2e.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
describe('nested drag and drop', () => {
it('should have correct model after moving between lists', () => {
browser.get('http://localhost:8080/nested.html')
browser.executeScript('$("#item2").simulate("drag-n-drop", { dragTarget: $("#item3"), interpolation: {stepWidth: 2, stepDelay: 30}});')
browser.sleep(1000)
element(by.id('main-list')).evaluate('$ctrl.lastDragged.name').then(function(value){
expect(value).toBe('item2');
})
browser.executeScript('$("#item3").simulate("drag-n-drop", { dragTarget: $("#subitem1"), interpolation: {stepWidth: 2, stepDelay: 30}});')
browser.sleep(1000)
element(by.id('main-list')).evaluate('$ctrl.lastDragged.name').then(function(value){
expect(value).toBe('item3');
})
browser.executeScript('$("#item1").simulate("drag-n-drop", { dragTarget: $("#item2"), interpolation: {stepWidth: 2, stepDelay: 30}});')
browser.sleep(1000)
element(by.id('main-list')).evaluate('$ctrl.lastDragged.name').then(function(value){
expect(value).toBe('item1');
})
})

it('should allow list with nested list to be dropped in a nested list', () => {
browser.get('http://localhost:8080/nested.html')
Expand Down

0 comments on commit a670535

Please sign in to comment.