Skip to content

Commit

Permalink
Add a test for setting a new widget position.
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Oct 13, 2016
1 parent b75cd89 commit 84e914f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/cases/widgetApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ describe('widget api', function () {
expect($(widget.canvas()).position()).toEqual({top: 0, left: 0});
});

it('Widgets positions can be changed', function () {
var o = makeMap(), widget = o.uiLayer.createWidget('dom', {
position: {left: 15, top: 10}});

expect($(widget.canvas()).position()).toEqual({top: 10, left: 15});
widget.position({top: null, bottom: '20%', left: 10});
expect(widget.position()).toEqual({top: null, bottom: '20%', left: 10});
expect($(widget.canvas()).position()).toEqual({top: 320, left: 10});
});

it('nested widgets should be properly structured', function () {
var o = makeMap();
var domWidget = o.uiLayer.createWidget('dom');
Expand Down

0 comments on commit 84e914f

Please sign in to comment.