Skip to content

Commit

Permalink
Fix broken gameplay UI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb531 committed Jul 11, 2019
1 parent 1b05383 commit 632e3bd
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/ui/gameplay.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('game UI', function () {
const grid = qs('#grid');
onPendingChipTransitionEnd()
.then(function (pendingChip) {
expect(pendingChip).to.have.translate(0, 384);
expect(pendingChip).to.have.translate(0, 600);
done();
})
.catch(done);
Expand All @@ -46,7 +46,7 @@ describe('game UI', function () {
const grid = qs('#grid');
onPendingChipTransitionEnd()
.then(function (pendingChip) {
expect(pendingChip).to.have.translate(192, 0);
expect(pendingChip).to.have.translate(300, 0);
done();
})
.catch(done);
Expand All @@ -62,12 +62,12 @@ describe('game UI', function () {
const grid = qs('#grid');
onPendingChipTransitionEnd()
.then(function (pendingChip) {
expect(pendingChip).to.have.translate(192, 0);
expect(pendingChip).to.have.translate(300, 0);
triggerMouseEvent(grid, 'click', 192, 0);
return onPendingChipTransitionEnd();
})
.then(function (pendingChip) {
expect(pendingChip).to.have.translate(192, 384);
expect(pendingChip).to.have.translate(300, 600);
done();
})
.catch(done);
Expand All @@ -84,25 +84,25 @@ describe('game UI', function () {
onPendingChipTransitionEnd()
.then(function (pendingChip) {
// Human chip's initial position
expect(pendingChip).to.have.translate(192, 0);
expect(pendingChip).to.have.translate(300, 0);
triggerMouseEvent(grid, 'click', 192, 0);
return onPendingChipTransitionEnd();
})
.then(function (pendingChip) {
// Human chip's final position
expect(pendingChip).to.have.translate(192, 384);
expect(pendingChip).to.have.translate(300, 600);
return onPendingChipTransitionEnd();
})
// AI's turn
.then(function (pendingChip) {
// AI chip's initial position
expect(pendingChip).to.have.class('black');
expect(pendingChip).to.have.translate(128, 0);
expect(pendingChip).to.have.translate(200, 0);
return onPendingChipTransitionEnd();
})
.then(function (pendingChip) {
// AI chip's final position
expect(pendingChip).to.have.translate(128, 384);
expect(pendingChip).to.have.translate(200, 600);
done();
})
.catch(done);
Expand All @@ -117,7 +117,7 @@ describe('game UI', function () {
const grid = qs('#grid');
onPendingChipTransitionEnd()
.then(function (pendingChip) {
expect(pendingChip).to.have.translate(192, 0);
expect(pendingChip).to.have.translate(300, 0);
done();
})
.catch(done);
Expand Down

0 comments on commit 632e3bd

Please sign in to comment.