@@ -1658,85 +1658,6 @@ void main() {
16581658 expect (envelope.clientReport, clientReport);
16591659 });
16601660
1661- test ('captureEvent adds trace context' , () async {
1662- final client = fixture.getSut ();
1663-
1664- final scope = Scope (fixture.options);
1665- scope.replayId = SentryId .newId ();
1666- scope.span =
1667- SentrySpan (fixture.tracer, fixture.tracer.context, MockHub ());
1668-
1669- await client.captureEvent (fakeEvent, scope: scope);
1670-
1671- final envelope = fixture.transport.envelopes.first;
1672- expect (envelope.header.traceContext, isNotNull);
1673- expect (envelope.header.traceContext? .replayId, scope.replayId);
1674- });
1675-
1676- test ('captureEvent adds attachments from hint' , () async {
1677- final attachment = SentryAttachment .fromIntList ([], "fixture-fileName" );
1678- final hint = Hint .withAttachment (attachment);
1679-
1680- final sut = fixture.getSut ();
1681- await sut.captureEvent (fakeEvent, hint: hint);
1682-
1683- final capturedEnvelope = (fixture.transport).envelopes.first;
1684- final attachmentItem = IterableUtils .firstWhereOrNull (
1685- capturedEnvelope.items,
1686- (SentryEnvelopeItem e) => e.header.type == SentryItemType .attachment,
1687- );
1688- expect (attachmentItem? .header.attachmentType,
1689- SentryAttachment .typeAttachmentDefault);
1690- });
1691-
1692- test ('captureEvent adds screenshot from hint' , () async {
1693- final client = fixture.getSut ();
1694- final screenshot =
1695- SentryAttachment .fromScreenshotData (Uint8List .fromList ([0 , 0 , 0 , 0 ]));
1696- final hint = Hint .withScreenshot (screenshot);
1697-
1698- await client.captureEvent (fakeEvent, hint: hint);
1699-
1700- final capturedEnvelope = (fixture.transport).envelopes.first;
1701- final attachmentItem = capturedEnvelope.items.firstWhereOrNull (
1702- (element) => element.header.type == SentryItemType .attachment);
1703- expect (attachmentItem? .header.fileName, 'screenshot.png' );
1704- });
1705-
1706- test ('captureEvent adds viewHierarchy from hint' , () async {
1707- final client = fixture.getSut ();
1708- final view = SentryViewHierarchy ('flutter' );
1709- final attachment = SentryAttachment .fromViewHierarchy (view);
1710- final hint = Hint .withViewHierarchy (attachment);
1711-
1712- await client.captureEvent (fakeEvent, hint: hint);
1713-
1714- final capturedEnvelope = (fixture.transport).envelopes.first;
1715- final attachmentItem = capturedEnvelope.items.firstWhereOrNull (
1716- (element) => element.header.type == SentryItemType .attachment);
1717-
1718- expect (attachmentItem? .header.attachmentType,
1719- SentryAttachment .typeViewHierarchy);
1720- });
1721-
1722- test ('captureTransaction adds trace context' , () async {
1723- final client = fixture.getSut ();
1724-
1725- final tr = SentryTransaction (fixture.tracer);
1726-
1727- final context = SentryTraceContextHeader .fromJson (< String , dynamic > {
1728- 'trace_id' : '${tr .eventId }' ,
1729- 'public_key' : '123' ,
1730- 'replay_id' : '456' ,
1731- });
1732-
1733- await client.captureTransaction (tr, traceContext: context);
1734-
1735- final envelope = fixture.transport.envelopes.first;
1736- expect (envelope.header.traceContext, isNotNull);
1737- expect (envelope.header.traceContext? .replayId, SentryId .fromId ('456' ));
1738- });
1739-
17401661 test ('captureUserFeedback calls flush' , () async {
17411662 final client = fixture.getSut (eventProcessor: DropAllEventProcessor ());
17421663
@@ -1953,6 +1874,14 @@ void main() {
19531874
19541875 expect (capturedEnvelope.header.dsn, fixture.options.dsn);
19551876 });
1877+ });
1878+
1879+ group ('Spotlight' , () {
1880+ late Fixture fixture;
1881+
1882+ setUp (() {
1883+ fixture = Fixture ();
1884+ });
19561885
19571886 test (
19581887 'Spotlight enabled should not set transport to SpotlightHttpTransport on iOS' ,
@@ -2034,13 +1963,15 @@ void main() {
20341963 final client = fixture.getSut ();
20351964
20361965 final scope = Scope (fixture.options);
1966+ scope.replayId = SentryId .newId ();
20371967 scope.span =
20381968 SentrySpan (fixture.tracer, fixture.tracer.context, MockHub ());
20391969
20401970 await client.captureEvent (fakeEvent, scope: scope);
20411971
20421972 final envelope = fixture.transport.envelopes.first;
20431973 expect (envelope.header.traceContext, isNotNull);
1974+ expect (envelope.header.traceContext? .replayId, scope.replayId);
20441975 });
20451976
20461977 test ('captureTransaction adds trace context' , () async {
@@ -2051,12 +1982,14 @@ void main() {
20511982 final context = SentryTraceContextHeader .fromJson (< String , dynamic > {
20521983 'trace_id' : '${tr .eventId }' ,
20531984 'public_key' : '123' ,
1985+ 'replay_id' : '456' ,
20541986 });
20551987
20561988 await client.captureTransaction (tr, traceContext: context);
20571989
20581990 final envelope = fixture.transport.envelopes.first;
20591991 expect (envelope.header.traceContext, isNotNull);
1992+ expect (envelope.header.traceContext? .replayId, SentryId .fromId ('456' ));
20601993 });
20611994
20621995 test ('captureFeedback adds trace context' , () async {
0 commit comments