Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76cbdaa37e | ||
|
|
5b1a2eff7f | ||
|
|
60422da644 |
@@ -28,3 +28,4 @@ backups/
|
||||
|
||||
# Local data / backups
|
||||
.data/
|
||||
scratch/
|
||||
|
||||
@@ -24,6 +24,7 @@ import VideoSection from './home/VideoSection';
|
||||
import CTA from './home/CTA';
|
||||
import { AgbHistoryBlock } from './AgbHistoryBlock';
|
||||
import { PDFDownloadBlock } from './PDFDownloadBlock';
|
||||
import ProductTechnicalData from './ProductTechnicalData';
|
||||
function ContactSection(props: any) {
|
||||
return (
|
||||
<div className="p-8 border-2 border-dashed border-primary my-8 text-center text-primary font-bold">
|
||||
@@ -100,6 +101,8 @@ async function Block(props: any) {
|
||||
return <AgbHistoryBlock {...data} />;
|
||||
case 'pdfDownload':
|
||||
return <PDFDownloadBlock {...data} />;
|
||||
case 'productTabs':
|
||||
return <ProductTechnicalData data={data} />;
|
||||
|
||||
default:
|
||||
return (
|
||||
|
||||
+106
-106
File diff suppressed because one or more lines are too long
+105
-105
File diff suppressed because one or more lines are too long
+107
-107
File diff suppressed because one or more lines are too long
+106
-106
File diff suppressed because one or more lines are too long
+106
-106
File diff suppressed because one or more lines are too long
@@ -56,6 +56,11 @@ export class GlitchtipErrorReportingService implements ErrorReportingService {
|
||||
tracesSampleRate: this.options.tracesSampleRate ?? 0.1,
|
||||
replaysOnErrorSampleRate: 1.0,
|
||||
replaysSessionSampleRate: 0.1,
|
||||
ignoreErrors: [
|
||||
'ChunkLoadError',
|
||||
'Failed to fetch dynamically imported module',
|
||||
'Failed to find Server Action',
|
||||
],
|
||||
});
|
||||
}
|
||||
return Sentry;
|
||||
|
||||
+1
-1
@@ -116,7 +116,7 @@
|
||||
"prepare": "husky",
|
||||
"preinstall": "npx only-allow pnpm"
|
||||
},
|
||||
"version": "2.3.31",
|
||||
"version": "2.3.32",
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": [
|
||||
"@parcel/watcher",
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
||||
import { GlitchtipErrorReportingService } from '../lib/services/errors/glitchtip-error-reporting-service';
|
||||
|
||||
// Mock the LoggerService
|
||||
const mockLogger = {
|
||||
child: vi.fn().mockReturnThis(),
|
||||
info: vi.fn(),
|
||||
error: vi.fn(),
|
||||
warn: vi.fn(),
|
||||
debug: vi.fn(),
|
||||
} as any;
|
||||
|
||||
const mockSentryInit = vi.fn();
|
||||
|
||||
vi.mock('@sentry/nextjs', () => ({
|
||||
init: (...args: any[]) => mockSentryInit(...args),
|
||||
captureException: vi.fn(),
|
||||
captureMessage: vi.fn(),
|
||||
}));
|
||||
|
||||
describe('GlitchtipErrorReportingService', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
it('should ignore version drift errors (ChunkLoadError and Server Action) in Sentry config', async () => {
|
||||
// Simulate window to force client-side init behavior instantly
|
||||
const originalWindow = global.window;
|
||||
global.window = {
|
||||
requestIdleCallback: (cb: Function) => cb(),
|
||||
} as any;
|
||||
|
||||
const service = new GlitchtipErrorReportingService({ enabled: true }, mockLogger);
|
||||
|
||||
// Give the dynamic import a moment to resolve
|
||||
await new Promise((resolve) => setTimeout(resolve, 50));
|
||||
|
||||
expect(mockSentryInit).toHaveBeenCalledOnce();
|
||||
const initCallArgs = mockSentryInit.mock.calls[0][0];
|
||||
|
||||
expect(initCallArgs.ignoreErrors).toBeDefined();
|
||||
expect(initCallArgs.ignoreErrors).toContain('ChunkLoadError');
|
||||
expect(initCallArgs.ignoreErrors).toContain('Failed to find Server Action');
|
||||
|
||||
global.window = originalWindow;
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
describe('MDXContent Mapping', () => {
|
||||
it('should have productTabs in the switch statement to prevent Unknown Block Type errors', () => {
|
||||
const filePath = path.join(process.cwd(), 'components/MDXContent.tsx');
|
||||
const fileContent = fs.readFileSync(filePath, 'utf-8');
|
||||
|
||||
// Check if the switch case for productTabs exists
|
||||
expect(fileContent).toContain("case 'productTabs':");
|
||||
expect(fileContent).toContain('<ProductTechnicalData');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user