Merge pull request #721 from nasa/open716

[Info Bubble] Fix bug with arrow positioning
This commit is contained in:
Andrew Henry 2016-03-11 13:13:49 -08:00
commit d39dea971f
2 changed files with 29 additions and 1 deletions

View File

@ -85,7 +85,6 @@ define(
popup.goesUp() ? 'arw-btm' : 'arw-top',
popup.goesLeft() ? 'arw-right' : 'arw-left'
].join(' ');
scope.bubbleLayout = 'arw-top arw-left';
// Create the info bubble, now that we know how to
// point the arrow...

View File

@ -109,6 +109,35 @@ define(
);
});
[ false, true ].forEach(function (goesLeft) {
[ false, true].forEach(function (goesUp) {
var vertical = goesUp ? "up" : "down",
horizontal = goesLeft ? "left" : "right",
location = [ vertical, horizontal].join('-');
describe("when bubble goes " + location, function () {
var expectedLocation = [
goesUp ? "bottom" : "top",
goesLeft ? "right" : "left"
].join('-');
beforeEach(function () {
mockPopup.goesUp.andReturn(goesUp);
mockPopup.goesDown.andReturn(!goesUp);
mockPopup.goesLeft.andReturn(goesLeft);
mockPopup.goesRight.andReturn(!goesLeft);
service.display('', '', {}, [ 10, 10 ]);
});
it("positions the arrow in the " + expectedLocation, function () {
expect(mockScope.bubbleLayout).toEqual([
goesUp ? "arw-btm" : "arw-top",
goesLeft ? "arw-right" : "arw-left"
].join(' '));
});
});
});
});
});
}
);