Skip to content

Commit e3d73ca

Browse files
authored
fix(solidstart): Make back navigation test less flaky (#13374)
🤞 Closes: #13345
1 parent 921e529 commit e3d73ca

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { A } from '@solidjs/router';
2+
3+
export default function BackNavigation() {
4+
return (
5+
<A id="navLink" href="/users/6">
6+
User 6
7+
</A>
8+
);
9+
}

dev-packages/e2e-tests/test-applications/solidstart/src/routes/index.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ export default function Home() {
2020
</A>
2121
</li>
2222
<li>
23-
<A id="navLinkUserBack" href="/users/6">
24-
User 6
25-
</A>
23+
<A href="/back-navigation">Test back navigation</A>
2624
</li>
2725
</ul>
2826
</>

dev-packages/e2e-tests/test-applications/solidstart/tests/performance.client.test.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ test('updates the transaction when using the back button', async ({ page }) => {
5454
return transactionEvent?.transaction === '/users/6' && transactionEvent.contexts?.trace?.op === 'navigation';
5555
});
5656

57-
await page.goto(`/`);
58-
await page.locator('#navLinkUserBack').click();
57+
await page.goto(`/back-navigation`);
58+
await page.locator('#navLink').click();
5959
const navigationTxn = await navigationTxnPromise;
6060

6161
expect(navigationTxn).toMatchObject({
@@ -72,7 +72,9 @@ test('updates the transaction when using the back button', async ({ page }) => {
7272
});
7373

7474
const backNavigationTxnPromise = waitForTransaction('solidstart', async transactionEvent => {
75-
return transactionEvent?.transaction === '/' && transactionEvent.contexts?.trace?.op === 'navigation';
75+
return (
76+
transactionEvent?.transaction === '/back-navigation' && transactionEvent.contexts?.trace?.op === 'navigation'
77+
);
7678
});
7779

7880
await page.goBack();
@@ -85,7 +87,7 @@ test('updates the transaction when using the back button', async ({ page }) => {
8587
origin: 'auto.navigation.solidstart.solidrouter',
8688
},
8789
},
88-
transaction: '/',
90+
transaction: '/back-navigation',
8991
transaction_info: {
9092
source: 'url',
9193
},

0 commit comments

Comments
 (0)