Skip to content

Commit 98792e3

Browse files
committed
fix more tests
1 parent 66f1569 commit 98792e3

File tree

3 files changed

+20
-56
lines changed

3 files changed

+20
-56
lines changed

static/app/gettingStartedDocs/javascript/solidstart/onboarding.spec.tsx

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ describe('javascript-solidstart onboarding docs', () => {
1515
expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();
1616

1717
expect(
18-
screen.getByText(
18+
screen.getAllByText(
1919
textWithMarkupMatcher(/import \* as Sentry from "@sentry\/solidstart"/)
20-
)
21-
).toBeInTheDocument();
20+
).length
21+
).toBeGreaterThanOrEqual(1);
2222

2323
expect(
24-
screen.getAllByText(textWithMarkupMatcher(/src\/entry-client\.tsx/))
25-
).toHaveLength(2);
24+
screen.getAllByText(textWithMarkupMatcher(/src\/entry-client\.tsx/)).length
25+
).toBeGreaterThanOrEqual(1);
2626
expect(
27-
screen.getByText(textWithMarkupMatcher(/public\/instrument\.server\.mjs/))
28-
).toBeInTheDocument();
27+
screen.getAllByText(textWithMarkupMatcher(/public\/instrument\.server\.mjs/)).length
28+
).toBeGreaterThanOrEqual(1);
2929
});
3030

3131
it('displays sample rates when performance and replay are selected', () => {
@@ -48,7 +48,7 @@ describe('javascript-solidstart onboarding docs', () => {
4848
).toBeInTheDocument();
4949
});
5050

51-
it('includes browserTracingIntegration when performance is selected', () => {
51+
it('includes tracing configuration when performance is selected', () => {
5252
renderWithOnboardingLayout(docs, {
5353
selectedProducts: [
5454
ProductSolution.ERROR_MONITORING,
@@ -57,8 +57,8 @@ describe('javascript-solidstart onboarding docs', () => {
5757
});
5858

5959
expect(
60-
screen.getByText(textWithMarkupMatcher(/Sentry\.browserTracingIntegration/))
61-
).toBeInTheDocument();
60+
screen.getAllByText(textWithMarkupMatcher(/tracesSampleRate: 1\.0/))
61+
).toHaveLength(2);
6262
});
6363

6464
it('includes replayIntegration when replay is selected', () => {
@@ -109,14 +109,14 @@ describe('javascript-solidstart onboarding docs', () => {
109109
).not.toBeInTheDocument();
110110
});
111111

112-
it('enables logs by setting enableLogs to true', () => {
112+
it('includes logging code in verify snippet when logs is selected', () => {
113113
renderWithOnboardingLayout(docs, {
114114
selectedProducts: [ProductSolution.ERROR_MONITORING, ProductSolution.LOGS],
115115
});
116116

117-
expect(screen.getAllByText(textWithMarkupMatcher(/enableLogs: true/))).toHaveLength(
118-
2
119-
);
117+
expect(
118+
screen.getByText(textWithMarkupMatcher(/Sentry\.logger\.info/))
119+
).toBeInTheDocument();
120120
});
121121

122122
it('shows Logging Integrations in next steps when logs is selected', () => {
@@ -154,15 +154,4 @@ describe('javascript-solidstart onboarding docs', () => {
154154
expect(docs.metricsOnboarding?.configure).toBeDefined();
155155
expect(docs.metricsOnboarding?.verify).toBeDefined();
156156
});
157-
158-
it('does not show Metrics in next steps when metrics is not selected', () => {
159-
renderWithOnboardingLayout(docs, {
160-
selectedProducts: [
161-
ProductSolution.ERROR_MONITORING,
162-
ProductSolution.PERFORMANCE_MONITORING,
163-
],
164-
});
165-
166-
expect(screen.queryByText('Metrics')).not.toBeInTheDocument();
167-
});
168157
});

static/app/gettingStartedDocs/javascript/solidstart/onboarding.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -336,17 +336,6 @@ export const onboarding: OnboardingConfig = {
336336
});
337337
}
338338

339-
if (params.isMetricsSelected) {
340-
steps.push({
341-
id: 'metrics',
342-
name: t('Metrics'),
343-
description: t(
344-
'Learn how to track custom metrics to monitor your application performance and business KPIs.'
345-
),
346-
link: 'https://docs.sentry.io/platforms/javascript/guides/solidstart/metrics/',
347-
});
348-
}
349-
350339
return steps;
351340
},
352341
};

static/app/gettingStartedDocs/javascript/tanstackstart-react/onboarding.spec.tsx

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ describe('javascript-tanstackstart-react onboarding docs', () => {
1515
expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();
1616

1717
expect(
18-
screen.getByText(
18+
screen.getAllByText(
1919
textWithMarkupMatcher(/import \* as Sentry from "@sentry\/tanstackstart-react"/)
20-
)
21-
).toBeInTheDocument();
20+
).length
21+
).toBeGreaterThanOrEqual(2);
2222
});
2323

2424
it('displays sample rates when performance and replay are selected', () => {
@@ -31,8 +31,8 @@ describe('javascript-tanstackstart-react onboarding docs', () => {
3131
});
3232

3333
expect(
34-
screen.getByText(textWithMarkupMatcher(/tracesSampleRate: 1\.0/))
35-
).toBeInTheDocument();
34+
screen.getAllByText(textWithMarkupMatcher(/tracesSampleRate: 1\.0/))
35+
).toHaveLength(2);
3636
expect(
3737
screen.getByText(textWithMarkupMatcher(/replaysSessionSampleRate: 0\.1/))
3838
).toBeInTheDocument();
@@ -72,10 +72,7 @@ describe('javascript-tanstackstart-react onboarding docs', () => {
7272
it('displays verify instructions', () => {
7373
renderWithOnboardingLayout(docs);
7474

75-
expect(screen.getByText(textWithMarkupMatcher(/Throw error/))).toBeInTheDocument();
76-
expect(
77-
screen.getByText(textWithMarkupMatcher(/Break the world/))
78-
).toBeInTheDocument();
75+
expect(screen.getAllByText(textWithMarkupMatcher(/Break the world/))).toHaveLength(2);
7976
});
8077

8178
it('has metrics onboarding configuration', () => {
@@ -84,15 +81,4 @@ describe('javascript-tanstackstart-react onboarding docs', () => {
8481
expect(docs.metricsOnboarding?.configure).toBeDefined();
8582
expect(docs.metricsOnboarding?.verify).toBeDefined();
8683
});
87-
88-
it('does not show Metrics in next steps when metrics is not selected', () => {
89-
renderWithOnboardingLayout(docs, {
90-
selectedProducts: [
91-
ProductSolution.ERROR_MONITORING,
92-
ProductSolution.PERFORMANCE_MONITORING,
93-
],
94-
});
95-
96-
expect(screen.queryByText('Metrics')).not.toBeInTheDocument();
97-
});
9884
});

0 commit comments

Comments
 (0)