Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// Where the Shows list's Select mode, which deletes several Shows at once (#1217), is offered: Debug and TestFlight
/// builds until Eric has tried it on a device.
/// Where the Shows list's Select mode, which deletes several Shows at once (#1217), is offered: everyone, since Eric
/// tried it on an iPhone from TestFlight 1.2.13 (2026-11-14).
public enum ShowCleanupAvailability {
/// Where it is offered; moving it up a level is this one line.
public static let level: AvailabilityLevel = .debugAndTestFlight
public static let level: AvailabilityLevel = .everyone

/// `environment` is nil until StoreKit has answered; only a sandbox (TestFlight) answer offers it in a Release build.
public static func isAvailable(isDebugBuild: Bool, environment: DistributionEnvironment?) -> Bool {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,16 @@
@testable import Recording
import Testing

/// Selecting several Shows and deleting them at once (#1217) is offered in Debug and TestFlight builds until Eric has
/// tried it on a device. Opening it up is this one rule.
/// Selecting several Shows and deleting them at once (#1217) is offered in every build, App Store included (Eric,
/// 2026-11-14), after he tried it on an iPhone from TestFlight build 1.2.13 (64.1).
@Suite("Show clean-up availability")
struct ShowCleanupAvailabilityTests {
@Test("Debug builds offer it whatever the environment, even before it is known")
func debugBuild() {
for environment: DistributionEnvironment? in [nil, .unknown, .sandbox, .production] {
#expect(ShowCleanupAvailability.isAvailable(isDebugBuild: true, environment: environment))
}
}

@Test("TestFlight (sandbox) builds offer it")
func testFlightBuild() {
@Test("Offered everywhere: Debug, TestFlight, the App Store, and before StoreKit has answered")
func everyone() {
#expect(ShowCleanupAvailability.isAvailable(isDebugBuild: true, environment: nil))
#expect(ShowCleanupAvailability.isAvailable(isDebugBuild: false, environment: .sandbox))
}

@Test("The App Store (production) build does not")
func appStoreBuild() {
#expect(!ShowCleanupAvailability.isAvailable(isDebugBuild: false, environment: .production))
}

@Test("A Release build whose environment is unknown or not yet answered does not")
func unknownEnvironment() {
#expect(!ShowCleanupAvailability.isAvailable(isDebugBuild: false, environment: nil))
#expect(!ShowCleanupAvailability.isAvailable(isDebugBuild: false, environment: .unknown))
#expect(ShowCleanupAvailability.isAvailable(isDebugBuild: false, environment: .production))
#expect(ShowCleanupAvailability.isAvailable(isDebugBuild: false, environment: .unknown))
#expect(ShowCleanupAvailability.isAvailable(isDebugBuild: false, environment: nil))
}
}
Loading