Skip to content

Commit

Permalink
Updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
minhtuevo committed Jan 7, 2025
1 parent 1f3031a commit 962464a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fiftyone/operators/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1848,17 +1848,18 @@ class Tooltip(View):
column: the column of the tooltip
"""

def __init__(self, row, column, **kwargs):
def __init__(self, row, column, value, **kwargs):
super().__init__(**kwargs)
self.row = row
self.column = column
self.value = value

def clone(self):
clone = Tooltip(self.row, self.column, **self._kwargs)
clone = Tooltip(self.row, self.column, self.value, **self._kwargs)
return clone

def to_json(self):
return {**super().to_json(), "row": self.row, "column": self.column}
return {**super().to_json(), "row": self.row, "column": self.column, "value": self.value}


class TableView(View):
Expand Down
1 change: 1 addition & 0 deletions tests/unittests/operators/tableview_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ def test_table_view_basic(self):
table.add_tooltip(1, 1, "Tooltip 3", overwrite=False)

table.add_tooltip(1, 1, "Tooltip 3")
self.assertEqual(set([tooltip.value for tooltip in table.tooltips]), {"Tooltip 2", "Tooltip 3"})

0 comments on commit 962464a

Please sign in to comment.