Skip to content

Commit

Permalink
2 more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NachoSoto committed Jul 14, 2023
1 parent 46748fb commit c0bbdaa
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Tests/RevenueCatUITests/PackageFilteringTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,31 @@ class PackageFilteringTests: TestCase {
expect(PaywallData.filter(packages: [Self.monthly, Self.annual], with: [.monthly])) == [Self.monthly]
}

func testFilterWithDuplicatedPackageTypes() {
expect(PaywallData.filter(packages: [Self.monthly, Self.annual], with: [.monthly, .monthly])) == [
Self.monthly,
Self.monthly
]
}

func testFilterReturningMultiplePackages() {
expect(PaywallData.filter(packages: [Self.weekly, Self.monthly, Self.annual], with: [.weekly, .monthly])) == [
Self.weekly,
Self.monthly
]
}

}

@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *)
private extension PackageFilteringTests {

static let weekly = Package(
identifier: "weekly",
packageType: .weekly,
storeProduct: TestData.productWithIntroOffer.toStoreProduct(),
offeringIdentifier: offeringIdentifier
)
static let monthly = Package(
identifier: "monthly",
packageType: .monthly,
Expand Down

0 comments on commit c0bbdaa

Please sign in to comment.