File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export * from '@sentry/node';
15
15
16
16
// Here we want to make sure to only include what doesn't have browser specifics
17
17
// because or SSR of next.js we can only use this.
18
- export { ErrorBoundary , withErrorBoundary } from '@sentry/react' ;
18
+ export { ErrorBoundary , showReportDialog , withErrorBoundary } from '@sentry/react' ;
19
19
20
20
type GlobalWithDistDir = typeof global & { __rewriteFramesDistDir__ : string } ;
21
21
const domain = domainModule as typeof domainModule & { active : ( domainModule . Domain & Carrier ) | null } ;
Original file line number Diff line number Diff line change
1
+ import { showReportDialog } from '@sentry/nextjs' ;
2
+
3
+ const ReportDialogPage = ( ) : JSX . Element => (
4
+ < button
5
+ onClick = { ( ) => {
6
+ showReportDialog ( ) ;
7
+ } }
8
+ >
9
+ Open Report Dialog
10
+ </ button >
11
+ ) ;
12
+
13
+ export default ReportDialogPage ;
Original file line number Diff line number Diff line change
1
+ const assert = require ( 'assert' ) ;
2
+
3
+ module . exports = async ( { page, url } ) => {
4
+ await page . goto ( `${ url } /reportDialog` ) ;
5
+
6
+ await page . click ( 'button' ) ;
7
+
8
+ const dialogScriptSelector = 'head > script[src^="https://dsn.ingest.sentry.io/api/embed/error-page"]' ;
9
+
10
+ const dialogScript = await page . waitForSelector ( dialogScriptSelector , { state : 'attached' } ) ;
11
+ const dialogScriptSrc = await ( await dialogScript . getProperty ( 'src' ) ) . jsonValue ( ) ;
12
+
13
+ assert ( dialogScriptSrc . startsWith ( 'https://dsn.ingest.sentry.io/api/embed/error-page/?' ) ) ;
14
+ } ;
You can’t perform that action at this time.
0 commit comments