Skip to content

Commit

Permalink
Paywalls: added test to ensure package selection maintains order (#…
Browse files Browse the repository at this point in the history
…2853)

I thought I saw a bug because this wasn't true, and realized that it's
important to cover in a test. The order of package should depend on the
setting, not the offering order. This test ensures that.
  • Loading branch information
NachoSoto committed Aug 17, 2023
1 parent 71fecbc commit ef3c7ab
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Tests/RevenueCatUITests/Data/TemplateViewConfigurationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,19 @@ class TemplateViewConfigurationFilteringTests: BaseTemplateViewConfigurationTest
]
}

func testFilterMaintainsOrder() {
expect(
TemplateViewConfiguration.filter(
packages: [TestData.weeklyPackage,
TestData.monthlyPackage,
TestData.annualPackage],
with: [.monthly, .weekly])
) == [
TestData.monthlyPackage,
TestData.weeklyPackage
]
}

}

// MARK: - Private
Expand Down

0 comments on commit ef3c7ab

Please sign in to comment.