Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions __tests/testing_web/test_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,23 @@ def index():
select.should_options_have_count(2)
select.should_options_have_text("foo", "bar")

def test_no_option_selected(context: Context):
data = {"Name": ['foo', 'bar']}
dataset = pybi.duckdb.from_pandas({"df": pd.DataFrame(data)})

@context.register_page
def index():
table = dataset["df"]
dv = pybi.data_view(f"SELECT * FROM {table}")

@ui.computed(inputs=[dv["Name"]])
def result(names):
return str(names)

pybi.select(dv["Name"])
pybi.label(result)

context.open()
select = Select(context)
select.should_not_selected_any()
context.should_see("['foo', 'bar']", equal_to=True)
6 changes: 6 additions & 0 deletions __tests/utils/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,9 @@ def click_items(self, *texts: str):
def click_clear_btn(self):
self.__page.locator(self.__target_selector).hover()
self.__page.click(f"{self.__target_selector} {_CLEAR_BTN_SELECTOR}")

def should_not_selected_any(self):
self.open_options()
selected_items = self.__page.locator(_OPTIONS_ITEM_SELECTED_SELECTOR)
expect(selected_items).to_have_count(0)

Loading