Skip to content

Commit

Permalink
Fixes the tests in phantomjs
Browse files Browse the repository at this point in the history
  • Loading branch information
dgavey committed Mar 29, 2017
1 parent 7f3c00f commit 4d0cebc
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/integration/components/sortable-objects-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,16 @@ test('sortable object renders draggable objects', function(assert) {
Ember.run(function() {
let event = MockDataTransfer.makeMockEvent();
event.originalEvent.clientX = 1;
event.originalEvent.clientY = 501;
event.originalEvent.clientY = 510;
triggerEvent($component.get(1), 'dragover', event);
});
andThen(function() {
//Drag over shows swapped items correctly
let $components = self.$('.sortObject');
assert.equal(self.$($components.get(0)).text().trim(), 'Number 2');
assert.equal(self.$($components.get(1)).text().trim(), 'Number 1');
assert.equal(self.$($components.get(2)).text().trim(), 'Number 3');
assert.equal(self.$($components.get(3)).text().trim(), 'Number 4');
assert.equal(self.$($components.get(0)).text().trim(), 'Number 2', 'before drop');
assert.equal(self.$($components.get(1)).text().trim(), 'Number 1', 'before drop');
assert.equal(self.$($components.get(2)).text().trim(), 'Number 3', 'before drop');
assert.equal(self.$($components.get(3)).text().trim(), 'Number 4', 'before drop');
});
Ember.run(function() {
triggerEvent($component, 'dragend', event);
Expand All @@ -126,10 +126,10 @@ test('sortable object renders draggable objects', function(assert) {
andThen(function() {
//Items are still visually in the correct order after drag end
let $components = self.$('.sortObject');
assert.equal(self.$($components.get(0)).text().trim(), 'Number 2');
assert.equal(self.$($components.get(1)).text().trim(), 'Number 1');
assert.equal(self.$($components.get(2)).text().trim(), 'Number 3');
assert.equal(self.$($components.get(3)).text().trim(), 'Number 4');
assert.equal(self.$($components.get(0)).text().trim(), 'Number 2', 'after drop');
assert.equal(self.$($components.get(1)).text().trim(), 'Number 1', 'after drop');
assert.equal(self.$($components.get(2)).text().trim(), 'Number 3', 'after drop');
assert.equal(self.$($components.get(3)).text().trim(), 'Number 4', 'after drop');
});

});
Expand Down Expand Up @@ -186,7 +186,7 @@ test('sortable object renders draggable objects using shift algorithm', function
});
andThen(function() {
let $components = self.$('.sortObject');
assert.equal(self.$($components.get(0)).text().trim(), 'Number 2');
assert.equal(self.$($components.get(0)).text().trim(), 'Number 2', 'before drop');
assert.equal(self.$($components.get(1)).text().trim(), 'Number 3');
assert.equal(self.$($components.get(2)).text().trim(), 'Number 1');
assert.equal(self.$($components.get(3)).text().trim(), 'Number 4');
Expand All @@ -199,7 +199,7 @@ test('sortable object renders draggable objects using shift algorithm', function
andThen(function() {
//Items are still visually in the correct order after drag end
let $components = self.$('.sortObject');
assert.equal(self.$($components.get(0)).text().trim(), 'Number 2');
assert.equal(self.$($components.get(0)).text().trim(), 'Number 2', 'after drop');
assert.equal(self.$($components.get(1)).text().trim(), 'Number 3');
assert.equal(self.$($components.get(2)).text().trim(), 'Number 1');
assert.equal(self.$($components.get(3)).text().trim(), 'Number 4');
Expand Down

0 comments on commit 4d0cebc

Please sign in to comment.