Skip to content

Commit 1209e12

Browse files
committed
fix three tests
1 parent bfa85de commit 1209e12

4 files changed

Lines changed: 13 additions & 7 deletions

File tree

reflex/.templates/web/vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default defineConfig((config) => ({
1414
port: process.env.PORT,
1515
},
1616
resolve: {
17-
mainFields: ['browser', 'module', 'jsnext'],
17+
mainFields: ["browser", "module", "jsnext"],
1818
alias: [
1919
{
2020
find: "$",

tests/integration/test_login_flow.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,21 @@ def test_login_flow(
113113
assert login_sample.frontend_url is not None
114114
local_storage.clear()
115115

116+
login_button = login_sample.poll_for_result(
117+
lambda: driver.find_element(By.ID, "login")
118+
)
116119
with pytest.raises(NoSuchElementException):
117120
driver.find_element(By.ID, "auth-token")
118121

119-
login_button = driver.find_element(By.ID, "login")
120122
login_sample.poll_for_content(login_button)
121123
with utils.poll_for_navigation(driver):
122124
login_button.click()
123-
assert driver.current_url.endswith("/login/")
125+
assert driver.current_url.endswith("/login")
124126

125127
do_it_button = driver.find_element(By.ID, "doit")
126128
with utils.poll_for_navigation(driver):
127129
do_it_button.click()
128-
assert driver.current_url == login_sample.frontend_url + "/"
130+
assert driver.current_url == login_sample.frontend_url
129131

130132
def check_auth_token_header():
131133
try:

tests/integration/test_memo.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ async def test_memo_app(memo_app: AppHarness):
8686
driver = memo_app.frontend()
8787

8888
# check that the output matches
89-
memo_custom_code_stack = driver.find_element(By.ID, "memo-custom-code")
89+
memo_custom_code_stack = memo_app.poll_for_result(
90+
lambda: driver.find_element(By.ID, "memo-custom-code")
91+
)
9092
assert (
9193
memo_app.poll_for_content(memo_custom_code_stack, exp_not_equal="")
9294
== "foobarbarbar"

tests/integration/test_navigation.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,13 @@ async def test_navigation_app(navigation_app: AppHarness):
7474

7575
with poll_for_navigation(driver):
7676
internal_link.click()
77-
assert urlsplit(driver.current_url).path == "/internal/"
77+
assert urlsplit(driver.current_url).path == "/internal"
7878
with poll_for_navigation(driver):
7979
driver.back()
8080

81-
external_link = driver.find_element(By.ID, "external")
81+
external_link = navigation_app.poll_for_result(
82+
lambda: driver.find_element(By.ID, "external")
83+
)
8284
external2_link = driver.find_element(By.ID, "external2")
8385

8486
external_link.click()

0 commit comments

Comments
 (0)