Remove Test Connection from source editing

The Test Connection buttons only probed API/server reachability, which
was misleading: a green result said nothing about whether videos would
actually play. Remove both the remote-server and WebDAV bandwidth test
buttons and all code exclusive to them (testBandwidth, BandwidthTestResult,
and orphaned localization keys). Add-time connectivity validation for
SMB/WebDAV sources is retained.
This commit is contained in:
Arkadiusz Fal
2026-05-19 20:40:28 +02:00
parent 858011c507
commit 88fafc5ada
6 changed files with 0 additions and 781 deletions

View File

@@ -154,101 +154,6 @@ struct LockedStorageTests {
}
}
// MARK: - BandwidthTestResult Tests
@Suite("BandwidthTestResult Tests")
struct BandwidthTestResultTests {
@Test("BandwidthTestResult with write access")
func bandwidthTestResultWithWrite() {
let result = BandwidthTestResult(
hasWriteAccess: true,
uploadSpeed: 50_000_000, // 50 MB/s
downloadSpeed: 100_000_000, // 100 MB/s
testFileSize: 5 * 1024 * 1024, // 5 MB
warning: nil
)
#expect(result.hasWriteAccess == true)
#expect(result.uploadSpeed == 50_000_000)
#expect(result.downloadSpeed == 100_000_000)
#expect(result.testFileSize == 5 * 1024 * 1024)
#expect(result.warning == nil)
}
@Test("BandwidthTestResult read-only mode")
func bandwidthTestResultReadOnly() {
let result = BandwidthTestResult(
hasWriteAccess: false,
uploadSpeed: nil,
downloadSpeed: 75_000_000,
testFileSize: 5 * 1024 * 1024,
warning: "Server is read-only"
)
#expect(result.hasWriteAccess == false)
#expect(result.uploadSpeed == nil)
#expect(result.downloadSpeed == 75_000_000)
#expect(result.warning == "Server is read-only")
}
@Test("BandwidthTestResult formatted speeds")
func bandwidthTestResultFormattedSpeeds() {
let result = BandwidthTestResult(
hasWriteAccess: true,
uploadSpeed: 50_000_000,
downloadSpeed: 100_000_000,
testFileSize: 5 * 1024 * 1024,
warning: nil
)
// Formatted strings should contain speed values (optional returns)
#expect(result.formattedDownloadSpeed != nil)
#expect(result.formattedUploadSpeed != nil)
#expect(result.formattedDownloadSpeed?.contains("/s") == true)
#expect(result.formattedUploadSpeed?.contains("/s") == true)
}
@Test("formattedUploadSpeed nil when no upload")
func formattedUploadSpeedNil() {
let result = BandwidthTestResult(
hasWriteAccess: false,
uploadSpeed: nil,
downloadSpeed: 50_000_000,
testFileSize: 5_000_000,
warning: nil
)
#expect(result.formattedUploadSpeed == nil)
}
@Test("formattedDownloadSpeed nil when no download")
func formattedDownloadSpeedNil() {
let result = BandwidthTestResult(
hasWriteAccess: false,
uploadSpeed: nil,
downloadSpeed: nil,
testFileSize: 0,
warning: "No files available"
)
#expect(result.formattedDownloadSpeed == nil)
}
@Test("Warning message preserved")
func warningPreserved() {
let result = BandwidthTestResult(
hasWriteAccess: false,
uploadSpeed: nil,
downloadSpeed: nil,
testFileSize: 0,
warning: "Server appears empty, could not test download speed"
)
#expect(result.warning == "Server appears empty, could not test download speed")
}
}
// MARK: - MediaSourceError Tests
@Suite("MediaSourceError Tests")