7.7.3+174; Black Friday trial on the Stripe builds is one month

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jonas Acker
2026-11-26 11:52:59 +01:00
parent 84ffb35cfe
commit 0cfc722c14
5 changed files with 14 additions and 14 deletions

View File

@@ -76,7 +76,7 @@ class ProTrial {
/// The Stripe builds (Windows outside the store, Microsoft Store Pro, Linux)
/// have no product to read a trial from. During this window the backend's
/// `stripe-checkout` adds a 60-day trial to yearly checkouts; this copy only
/// `stripe-checkout` adds a 30-day trial to yearly checkouts; this copy only
/// decides when the paywall says so, and must match the backend.
class StripeYearlyTrialPromo {
const StripeYearlyTrialPromo._();
@@ -85,7 +85,7 @@ class StripeYearlyTrialPromo {
static final DateTime startsAt = DateTime.utc(2026, 11, 26, 10);
static final DateTime endsAt = DateTime.utc(2026, 11, 28, 12);
static const ProTrial trial = ProTrial(ProTrialUnit.month, 2);
static const ProTrial trial = ProTrial(ProTrialUnit.month, 1);
@visibleForTesting
static DateTime Function() now = DateTime.now;

View File

@@ -2000,8 +2000,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "b87bf636cb04ab37ca3dad1f3a3e30fdf8c9d9c3"
resolved-ref: "b87bf636cb04ab37ca3dad1f3a3e30fdf8c9d9c3"
ref: "14a8c73f88f50cb4196e5e55e682aa76b718b694"
resolved-ref: "14a8c73f88f50cb4196e5e55e682aa76b718b694"
url: "https://github.com/jonasbark/universal_ble.git"
source: git
version: "3.1.0"

View File

@@ -1,7 +1,7 @@
name: bike_control
description: "BikeControl - Control your virtual riding"
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 7.7.2+173
version: 7.7.3+174
environment:
sdk: ^3.9.0

View File

@@ -111,12 +111,12 @@ Future<void> main() async {
});
group('Stripe builds', () {
testWidgets('show two months free on yearly inside the window', (tester) async {
testWidgets('show a month free on yearly inside the window', (tester) async {
StripeYearlyTrialPromo.now = () => DateTime.utc(2026, 11, 27, 12);
await pump(tester, Paywall(debugNativeTrainer: () => null), channel: PurchaseChannel.windowsDirect);
expect(find.text('BLACK FRIDAY · 2 months free'), findsOneWidget);
expect(find.text('Try Pro free for 2 months'), findsOneWidget);
expect(find.text(AppLocalizations.current.paywall_trialThenBilledYearly('2 months')), findsOneWidget);
expect(find.text('BLACK FRIDAY · 1 month free'), findsOneWidget);
expect(find.text('Try Pro free for 1 month'), findsOneWidget);
expect(find.text(AppLocalizations.current.paywall_trialThenBilledYearly('1 month')), findsOneWidget);
});
testWidgets('show no trial outside the window', (tester) async {

View File

@@ -151,12 +151,12 @@ void main() {
expect(StripeYearlyTrialPromo.isRunning, isFalse);
});
test('offers two months on the Stripe builds only', () {
test('offers a month on the Stripe builds only', () {
at(DateTime.utc(2026, 11, 27, 12));
const twoMonths = ProTrial(ProTrialUnit.month, 2);
expect(StripeYearlyTrialPromo.trialOn(PurchaseChannel.windowsDirect), twoMonths);
expect(StripeYearlyTrialPromo.trialOn(PurchaseChannel.microsoftStore), twoMonths);
expect(StripeYearlyTrialPromo.trialOn(PurchaseChannel.linuxDirect), twoMonths);
const oneMonth = ProTrial(ProTrialUnit.month, 1);
expect(StripeYearlyTrialPromo.trialOn(PurchaseChannel.windowsDirect), oneMonth);
expect(StripeYearlyTrialPromo.trialOn(PurchaseChannel.microsoftStore), oneMonth);
expect(StripeYearlyTrialPromo.trialOn(PurchaseChannel.linuxDirect), oneMonth);
// The stores carry their own trial on the product.
expect(StripeYearlyTrialPromo.trialOn(PurchaseChannel.appStore), isNull);
expect(StripeYearlyTrialPromo.trialOn(PurchaseChannel.macAppStore), isNull);