Files
purchases-ios/Tests/UnitTests/Networking/Responses/GetIntroEligibilityDecodingTests.swift
T
Antonio Pallares 81aaf6a051 Offering hasPaywall getter (#4847)
* feat: add `hasPaywall` getter to `Offering`

Returns `true` if the offering has either a v1 or a v2 paywall

* docs: update some methods references changing `PaywallData` with "paywall", as `PaywallData` only refers to v1 paywalls

* docs: improve reference of `Offering`'s `paywall` and `paywallComponents` to mention the new `hasPaywall` property

* lint

* tests: add unit tests that check the `hasPaywall` property of `Offering`

* api tests: add `paywallComponents` and `hasPaywall` to SwiftAPITester
2025-03-04 12:09:53 +01:00

38 lines
963 B
Swift

//
// Copyright RevenueCat Inc. All Rights Reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// GetIntroEligibilityDecodingTests.swift
//
// Created by Nacho Soto on 5/12/22.
import Nimble
@testable import RevenueCat
import XCTest
class GetIntroEligibilityDecodingTests: BaseHTTPResponseTest {
private var response: GetIntroEligibilityResponse!
override func setUpWithError() throws {
try super.setUpWithError()
self.response = try Self.decodeFixture("GetIntroEligibility")
}
func testResponseDataIsCorrect() throws {
expect(self.response.eligibilityByProductIdentifier) == [
"producta": .eligible,
"productb": .ineligible,
"product_c": .unknown,
"productD": .eligible
]
}
}