Skip to content

Commit 9e90da1

Browse files
committed
Expect introductoryPriceAmountMicros to be String.
Update the unit test so it tests for the introductoryPriceAmountMicros field to be of type String. This test will be failing to prove the issue described here flutter#4364 (comment).
1 parent 172201d commit 9e90da1

File tree

1 file changed

+3
-1
lines changed
  • packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase

1 file changed

+3
-1
lines changed

packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/TranslatorTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,10 @@ private void assertSerialized(SkuDetails expected, Map<String, Object> serialize
207207
assertEquals(expected.getDescription(), serialized.get("description"));
208208
assertEquals(expected.getFreeTrialPeriod(), serialized.get("freeTrialPeriod"));
209209
assertEquals(expected.getIntroductoryPrice(), serialized.get("introductoryPrice"));
210+
// Make sure the `introductoryPriceAmountMicros` field is returned as a `String` value as the
211+
// Dart side expects it as `String`. Changing the type there would introduce a breaking change.
210212
assertEquals(
211-
expected.getIntroductoryPriceAmountMicros(),
213+
String.valueOf(expected.getIntroductoryPriceAmountMicros()),
212214
serialized.get("introductoryPriceAmountMicros"));
213215
assertEquals(expected.getIntroductoryPriceCycles(), serialized.get("introductoryPriceCycles"));
214216
assertEquals(expected.getIntroductoryPricePeriod(), serialized.get("introductoryPricePeriod"));

0 commit comments

Comments
 (0)