Skip to content

Commit

Permalink
chore(test): fix breaking tests
Browse files Browse the repository at this point in the history
SUITEDEV-36111

Co-authored-by:	davidSchuppa <[email protected]>
Co-authored-by:	matusekma <[email protected]>
  • Loading branch information
LordAndras committed Jul 9, 2024
1 parent 6a66e71 commit b32da61
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 0 additions & 6 deletions example/integration_test/config_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
const APPLICATION_CODE = "EMS11-C3FD3";
const MERCHANT_ID = "EMS11C3FD3";
const CONTACT_FIELD_ID = 2575;

setUpAll(() async {
final config = EmarsysConfig(
Expand Down Expand Up @@ -36,11 +35,6 @@ void main() {
.onError((error, stackTrace) => onErrorHasBeenCalled = true);
expect(onErrorHasBeenCalled, false);
});
testWidgets("contactFieldValue should return the expected value",
(WidgetTester tester) async {
final result = await Emarsys.config.contactFieldId();
expect(result, equals(CONTACT_FIELD_ID));
});
testWidgets("languageCode should return a non-null value",
(WidgetTester tester) async {
final result = await Emarsys.config.languageCode();
Expand Down
7 changes: 6 additions & 1 deletion example/integration_test/emarsys_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';

void main() {
const CONTACT_FIELD_ID = 2575;

IntegrationTestWidgetsFlutterBinding.ensureInitialized();

setUpAll(() async {
final config = EmarsysConfig(applicationCode: "EMS11-C3FD3");
await Emarsys.setup(config);
});

testWidgets("call setContact", (WidgetTester tester) async {
testWidgets("call setContact and check contactFieldId", (WidgetTester tester) async {
await Emarsys.setContact(2575, "[email protected]")
.then((value) => print("SET CONTACT"))
.catchError((error) => expect(error, null));

final result = await Emarsys.config.contactFieldId();
expect(result, equals(CONTACT_FIELD_ID));
});

testWidgets("call clearContact", (WidgetTester tester) async {
Expand Down
1 change: 1 addition & 0 deletions example/integration_test/push_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ void main() {
});

testWidgets("call pushSendingEnabled with true", (WidgetTester tester) async {
await Future.delayed(Duration(seconds: 3));
await Emarsys.push
.pushSendingEnabled(true)
.catchError((error) => expect(error, null));
Expand Down

0 comments on commit b32da61

Please sign in to comment.