Skip to content

Commit 2ead7ac

Browse files
committed
fix(run tests): hide button in dialog after clicking link
1 parent 7f105d5 commit 2ead7ac

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

testgen/ui/views/dialogs/run_tests_dialog.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@ def run_tests_dialog(project_code: str, test_suite: TestSuiteMinimal | None = No
5353
button_container = st.empty()
5454
status_container = st.empty()
5555

56+
link_clicked = st.session_state.get(LINK_KEY)
5657
run_test_button = None
57-
with button_container:
58-
_, button_column = st.columns([.8, .2])
59-
with button_column:
60-
run_test_button = st.button("Run Tests", use_container_width=True, disabled=not test_suite_id)
58+
if not link_clicked:
59+
with button_container:
60+
_, button_column = st.columns([.8, .2])
61+
with button_column:
62+
run_test_button = st.button("Run Tests", use_container_width=True, disabled=not test_suite_id)
6163

6264
if run_test_button:
6365
button_container.empty()
@@ -69,7 +71,7 @@ def run_tests_dialog(project_code: str, test_suite: TestSuiteMinimal | None = No
6971
status_container.error(f"Test run encountered errors: {e!s}.")
7072

7173
# The second condition is needed for the link to work
72-
if run_test_button or st.session_state.get(LINK_KEY):
74+
if run_test_button or link_clicked:
7375
with status_container.container():
7476
st.success(
7577
f"Test run started for test suite **{test_suite_name}**."

0 commit comments

Comments
 (0)