Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NachoSoto committed Nov 15, 2023
1 parent 3e965ef commit 1c3acb1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api_tester/lib/api_tests/purchases_flutter_api_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -512,4 +512,9 @@ class _PurchasesFlutterApiTest {
Future<void> future = Purchases.showInAppMessages(types: {InAppMessageType.billingIssue,
InAppMessageType.priceIncreaseConsent, InAppMessageType.generic});
}

void _checkPaywalls() async {
Future<bool> future1 = Purchases.presentPaywall();
Future<bool> future2 = Purchases.presentPaywallIfNeeded("test");
}
}
25 changes: 25 additions & 0 deletions test/purchases_flutter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1269,4 +1269,29 @@ void main() {
),
]);
});

test('presentPaywall', () async {
response = Random().nextBool();
await Purchases.presentPaywall();
expect(log, <Matcher>[
isMethodCall(
'presentPaywall',
arguments: null,
),
]);
});

test('presentPaywallIfNeeded', () async {
response = Random().nextBool();
const entitlement = 'pro';
await Purchases.presentPaywallIfNeeded(entitlement);
expect(log, <Matcher>[
isMethodCall(
'presentPaywallIfNeeded',
arguments: {
'requiredEntitlementIdentifier': entitlement,
},
),
]);
});
}

0 comments on commit 1c3acb1

Please sign in to comment.