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
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ test.describe('client - pageload performance', () => {
});

await page.goto(`/performance`);
await page.getByRole('heading', { name: 'Performance Page' }).waitFor();

const transaction = await txPromise;

Expand Down Expand Up @@ -62,6 +63,7 @@ test.describe('client - pageload performance', () => {
});

await page.goto(`/performance/with/sentry`);
await page.getByRole('heading', { name: 'Dynamic Parameter Page' }).waitFor();

const transaction = await txPromise;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ test.describe('client - pageload performance', () => {
});

await page.goto(`/performance`);
await page.getByRole('heading', { name: 'Performance Page' }).waitFor();

const transaction = await txPromise;

Expand Down Expand Up @@ -62,6 +63,7 @@ test.describe('client - pageload performance', () => {
});

await page.goto(`/performance/with/sentry`);
await page.getByRole('heading', { name: 'Dynamic Parameter Page' }).waitFor();

const transaction = await txPromise;

Expand Down
28 changes: 24 additions & 4 deletions packages/react/test/reactrouter-cross-usage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,14 @@ describe('React Router cross usage of wrappers', () => {

await act(async () => {
router.navigate('/settings');
await waitFor(() => expect(mockStartBrowserTracingNavigationSpan).toHaveBeenCalledTimes(1));
});

await waitFor(() => {
expect(router.state.navigation.state).toBe('idle');
expect(router.state.location.pathname).toBe('/settings');
});
await waitFor(() => expect(mockStartBrowserTracingNavigationSpan).toHaveBeenCalledTimes(1));

expect(mockStartBrowserTracingNavigationSpan).toHaveBeenLastCalledWith(expect.any(BrowserClient), {
name: '/settings',
attributes: {
Expand All @@ -641,9 +646,14 @@ describe('React Router cross usage of wrappers', () => {

await act(async () => {
router.navigate('/profile');
await waitFor(() => expect(mockStartBrowserTracingNavigationSpan).toHaveBeenCalledTimes(2));
});

await waitFor(() => {
expect(router.state.navigation.state).toBe('idle');
expect(router.state.location.pathname).toBe('/profile');
});
await waitFor(() => expect(mockStartBrowserTracingNavigationSpan).toHaveBeenCalledTimes(2));

expect(mockStartBrowserTracingNavigationSpan).toHaveBeenCalledTimes(2);

const calls = mockStartBrowserTracingNavigationSpan.mock.calls;
Expand Down Expand Up @@ -734,9 +744,14 @@ describe('React Router cross usage of wrappers', () => {

await act(async () => {
router.navigate('/user/2');
await waitFor(() => expect(mockStartBrowserTracingNavigationSpan).toHaveBeenCalledTimes(1));
});

await waitFor(() => {
expect(router.state.navigation.state).toBe('idle');
expect(router.state.location.pathname).toBe('/user/2');
});
await waitFor(() => expect(mockStartBrowserTracingNavigationSpan).toHaveBeenCalledTimes(1));

expect(mockStartBrowserTracingNavigationSpan).toHaveBeenCalledTimes(1);
expect(mockStartBrowserTracingNavigationSpan).toHaveBeenCalledWith(expect.any(BrowserClient), {
name: '/user/:id',
Expand All @@ -749,9 +764,14 @@ describe('React Router cross usage of wrappers', () => {

await act(async () => {
router.navigate('/user/3');
await waitFor(() => expect(mockStartBrowserTracingNavigationSpan).toHaveBeenCalledTimes(2));
});

await waitFor(() => {
expect(router.state.navigation.state).toBe('idle');
expect(router.state.location.pathname).toBe('/user/3');
});
await waitFor(() => expect(mockStartBrowserTracingNavigationSpan).toHaveBeenCalledTimes(2));

// Should create 2 spans - different concrete paths are different user actions
expect(mockStartBrowserTracingNavigationSpan).toHaveBeenCalledTimes(2);
expect(mockStartBrowserTracingNavigationSpan).toHaveBeenNthCalledWith(2, expect.any(BrowserClient), {
Expand Down
Loading