Skip to content

Commit 4bb3ceb

Browse files
committed
add to integration test, fix analyze errors
1 parent 06a4a5f commit 4bb3ceb

File tree

5 files changed

+23
-2
lines changed

5 files changed

+23
-2
lines changed

dart/lib/src/sentry.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class Sentry {
226226
/// Reports [SentryFeedback] to Sentry.io.
227227
///
228228
/// Use [withScope] to add [SentryAttachment] to the feedback.
229-
static Future<void> captureFeedback(
229+
static Future<SentryId> captureFeedback(
230230
SentryFeedback feedback, {
231231
Hint? hint,
232232
ScopeCallback? withScope,

dio/test/mocks/mock_hub.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:meta/meta.dart';
2-
32
import 'package:sentry/sentry.dart';
43

54
import 'no_such_method_provider.dart';
@@ -10,6 +9,8 @@ class MockHub with NoSuchMethodProvider implements Hub {
109
List<CaptureMessageCall> captureMessageCalls = [];
1110
List<AddBreadcrumbCall> addBreadcrumbCalls = [];
1211
List<SentryClient?> bindClientCalls = [];
12+
13+
// ignore: deprecated_member_use
1314
List<SentryUserFeedback> userFeedbackCalls = [];
1415
List<SentryTransaction> captureTransactionCalls = [];
1516
int closeCalls = 0;
@@ -121,6 +122,7 @@ class MockHub with NoSuchMethodProvider implements Hub {
121122
}
122123

123124
@override
125+
// ignore: deprecated_member_use
124126
Future<void> captureUserFeedback(SentryUserFeedback userFeedback) async {
125127
userFeedbackCalls.add(userFeedback);
126128
}

flutter/example/integration_test/integration_test.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,31 @@ void main() {
8686
await setupSentryAndApp(tester);
8787

8888
// ignore: deprecated_member_use_from_same_package
89+
// ignore: deprecated_member_use
8990
final feedback = SentryUserFeedback(
9091
eventId: SentryId.newId(),
9192
name: 'fixture-name',
9293
9394
comments: 'fixture-comments');
95+
// ignore: deprecated_member_use
9496
await Sentry.captureUserFeedback(feedback);
9597
});
9698

99+
testWidgets('setup sentry and capture feedback', (tester) async {
100+
await setupSentryAndApp(tester);
101+
102+
// ignore: deprecated_member_use_from_same_package
103+
// ignore: deprecated_member_use
104+
final associatedEventId = await Sentry.captureMessage("Associated");
105+
final feedback = SentryFeedback(
106+
message: 'message',
107+
contactEmail: '[email protected]',
108+
name: 'John Appleseed',
109+
associatedEventId: associatedEventId,
110+
);
111+
await Sentry.captureFeedback(feedback);
112+
});
113+
97114
testWidgets('setup sentry and close', (tester) async {
98115
await setupSentryAndApp(tester);
99116

isar/test/mocks/mocks.mocks.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ class MockHub extends _i1.Mock implements _i2.Hub {
286286
) as _i3.Future<_i2.SentryId>);
287287

288288
@override
289+
// ignore: deprecated_member_use
289290
_i3.Future<void> captureUserFeedback(_i2.SentryUserFeedback? userFeedback) =>
290291
(super.noSuchMethod(
291292
Invocation.method(

sqflite/test/mocks/mocks.mocks.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,6 +1453,7 @@ class MockHub extends _i1.Mock implements _i2.Hub {
14531453
)),
14541454
) as _i4.Future<_i2.SentryId>);
14551455
@override
1456+
// ignore: deprecated_member_use
14561457
_i4.Future<void> captureUserFeedback(_i2.SentryUserFeedback? userFeedback) =>
14571458
(super.noSuchMethod(
14581459
Invocation.method(

0 commit comments

Comments
 (0)