-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding stimulus breaks a test...why? #1268
Comments
- Avoid issue described here: hotwired#1268
There is a bit of a race condition at turbo/src/tests/functional/loading_tests.js Lines 15 to 18 in 3163a06
With some logging: diff --git a/src/tests/fixtures/test.js b/src/tests/fixtures/test.js
index 0501e2e..b3fdc5b 100644
--- a/src/tests/fixtures/test.js
+++ b/src/tests/fixtures/test.js
@@ -33,6 +33,7 @@
}
function eventListener(event) {
+ console.log(event.type)
const skipped = document.documentElement.getAttribute("data-skip-event-details") || ""
window.eventLogs.push([
diff --git a/src/tests/functional/loading_tests.js b/src/tests/functional/loading_tests.js
index 4390dfd..15ba185 100644
--- a/src/tests/functional/loading_tests.js
+++ b/src/tests/functional/loading_tests.js
@@ -14,6 +14,7 @@ import {
test.beforeEach(async ({ page }) => {
await page.goto("/src/tests/fixtures/loading.html")
+ await page.evaluate(() => console.log("readevents"))
await readEventLogs(page)
})
You can see
when you try to import stimulus:
During the test in question turbo/src/tests/functional/loading_tests.js Line 102 in 3163a06
|
Can someone help me understand why adding this block above the
</head>
tag ofsrc/tests/fixtures/loading.html
breaks a test?Test that breaks:
The same line exists in
src/tests/fixtures/page_refresh.html
so I'm not sure why it works there but not in loading.htmlThe text was updated successfully, but these errors were encountered: