Skip to content

Commit

Permalink
Add popup open event test
Browse files Browse the repository at this point in the history
  • Loading branch information
James Meyers authored and jfirebaugh committed Mar 10, 2018
1 parent 3c5cc10 commit f94e1f9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/unit/ui/popup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,21 @@ test('Popup fires close event when removed', (t) => {
t.end();
});


test('Popup fires open event when added', (t) => {
const map = createMap();
const onOpen = t.spy();

new Popup()
.setText("Test")
.setLngLat([0, 0])
.on('open', onOpen)
.addTo(map);

t.ok(onOpen.called);
t.end();
});

test('Popup content can be set via setText', (t) => {
const map = createMap();

Expand Down

0 comments on commit f94e1f9

Please sign in to comment.