',
- attributes: expect.objectContaining({
- 'sentry.origin': 'auto.http.browser.cls',
- 'sentry.op': 'ui.webvital.cls',
- 'sentry.pageload.span_id': 'pageload-789',
- 'browser.web_vital.cls.source.1': '
',
- 'browser.web_vital.cls.source.2': '',
- 'browser.web_vital.cls.report_event': 'navigation',
- 'sentry.transaction': 'test-route',
- }),
- parentSpan: mockPageloadSpan,
- }),
- );
- });
-
- it('sends a streamed CLS span without entry data', () => {
- _sendClsSpan(0, undefined);
-
- expect(SentryCore.timestampInSeconds).toHaveBeenCalled();
- expect(SentryCore.startInactiveSpan).toHaveBeenCalledWith(
- expect.objectContaining({
- name: 'Layout shift',
- startTime: 1.5,
- }),
- );
- });
-});
-
-describe('_sendInpSpan', () => {
- const mockSpan = {
- end: vi.fn(),
- };
-
- const mockScope = {
- getScopeData: vi.fn().mockReturnValue({
- transactionName: 'test-route',
- }),
- };
-
- beforeEach(() => {
- vi.mocked(SentryCore.getCurrentScope).mockReturnValue(mockScope as any);
- vi.mocked(SentryCore.browserPerformanceTimeOrigin).mockReturnValue(1000);
- vi.mocked(htmlTreeAsString).mockReturnValue('