Skip to content

Commit

Permalink
Add a unit test to verify inspector output is cleared on second click
Browse files Browse the repository at this point in the history
  • Loading branch information
naschmitz committed Aug 15, 2023
1 parent 8a84c0a commit 8e7aef5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_map_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,23 @@ def test_map_click(self):
self.assertIsNotNone(self._query_node(layer_3_root, "linearid: 110469267091"))
self.assertIsNotNone(self._query_node(layer_3_root, "mtfcc: S1400"))
self.assertIsNotNone(self._query_node(layer_3_root, "rttyp: "))

def test_map_click_twice(self):
"""Tests that clicking the map a second time removes the original output."""
self.map_fake.ee_layer_dict = {
"test-map-1": {
"ee_object": ee.Image(1),
"ee_layer": fake_map.FakeEeTileLayer(visible=True),
"vis_params": None,
},
}
self.map_fake.scale = 32
self.map_fake.click((1, 2), "click")
self.map_fake.click((4, 1), "click")

self.assertIsNotNone(
self._query_node(self.inspector, "Point (1.00, 4.00) at 32m/px")
)
self.assertIsNone(
self._query_node(self.inspector, "Point (2.00, 1.00) at 1024m/px")
)

0 comments on commit 8e7aef5

Please sign in to comment.