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 @@ -3,11 +3,19 @@ import type { Event } from '@sentry/core';
import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';

sentryTest('should not accept non-primitive tags', async ({ getLocalTestUrl, page }) => {
sentryTest('[bug] accepts non-primitive tags', async ({ getLocalTestUrl, page }) => {
// this is a bug that went unnoticed due to type definitions and a bad assertion
// TODO: We should not accept non-primitive tags. Fix this as a follow-up.
const url = await getLocalTestUrl({ testDir: __dirname });

const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);

expect(eventData.message).toBe('non_primitives');
expect(eventData.tags).toMatchObject({});

// TODO: This should be an empty object but instead, it is:
expect(eventData.tags).toEqual({
tag_1: {},
tag_2: [],
tag_3: ['a', {}],
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sentryTest('should set primitive tags', async ({ getLocalTestUrl, page }) => {
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);

expect(eventData.message).toBe('primitive_tags');
expect(eventData.tags).toMatchObject({
expect(eventData.tags).toEqual({
tag_1: 'foo',
tag_2: 3.141592653589793,
tag_3: false,
Expand Down
Loading