diff --git a/Sources/Bagbutik-Models/Extensions/AppMediaStateError+MoreInfo.swift b/Sources/Bagbutik-Models/Extensions/AppMediaStateError+MoreInfo.swift index 6b36f158f..38348539b 100644 --- a/Sources/Bagbutik-Models/Extensions/AppMediaStateError+MoreInfo.swift +++ b/Sources/Bagbutik-Models/Extensions/AppMediaStateError+MoreInfo.swift @@ -8,9 +8,16 @@ public extension AppMediaStateError { */ var betterDescription: String { if description == "IMAGE_INCORRECT_DIMENSIONS" { - return "The dimensions of the screenshot is wrong" + "The dimensions of the screenshot is wrong" + } else if description == "MOV_RESAVE_STEREO" { + "The App Preview contains unsupported or corrupted audio" + } else if description == "MOV_RESAVE_LONGER" { + "The App Preview's duration is too short" + } else if description == "MOV_RESAVE_TRIM" { + "The App Preview is too large" + } else { + description! } - return description! } /** @@ -20,7 +27,9 @@ public extension AppMediaStateError { */ var learnMoreUrl: URL? { if code == "IMAGE_INCORRECT_DIMENSIONS" { - return URL(string: "https://help.apple.com/app-store-connect/#/devd274dd925") + return URL(string: "https://developer.apple.com/help/app-store-connect/reference/screenshot-specifications") + } else if code == "MOV_RESAVE_STEREO" || code == "MOV_RESAVE_LONGER" || code == "MOV_RESAVE_TRIM" { + return URL(string: "https://developer.apple.com/help/app-store-connect/reference/app-preview-specifications") } return nil } diff --git a/Tests/Bagbutik-ModelsTests/Extensions/AppMediaStateError+MoreInfoTests.swift b/Tests/Bagbutik-ModelsTests/Extensions/AppMediaStateError+MoreInfoTests.swift index 68c028ca5..fb3a7ba2c 100644 --- a/Tests/Bagbutik-ModelsTests/Extensions/AppMediaStateError+MoreInfoTests.swift +++ b/Tests/Bagbutik-ModelsTests/Extensions/AppMediaStateError+MoreInfoTests.swift @@ -7,6 +7,21 @@ final class AppMediaStateErrorMoreInfoTests: XCTestCase { XCTAssertNotEqual(error.betterDescription, error.description) } + func testBetterDescription_MovieResaveStereo() { + let error = AppMediaStateError(code: "MOV_RESAVE_STEREO", description: "MOV_RESAVE_STEREO") + XCTAssertNotEqual(error.betterDescription, error.description) + } + + func testBetterDescription_MovieResaveLonger() { + let error = AppMediaStateError(code: "MOV_RESAVE_LONGER", description: "MOV_RESAVE_LONGER") + XCTAssertNotEqual(error.betterDescription, error.description) + } + + func testBetterDescription_MovieResaveTrim() { + let error = AppMediaStateError(code: "MOV_RESAVE_TRIM", description: "MOV_RESAVE_TRIM") + XCTAssertNotEqual(error.betterDescription, error.description) + } + func testBetterDescription_Unknown() { let error = AppMediaStateError(code: "SOME_ERROR", description: "SOME_ERROR") XCTAssertEqual(error.betterDescription, error.description) @@ -17,6 +32,21 @@ final class AppMediaStateErrorMoreInfoTests: XCTestCase { XCTAssertNotNil(error.learnMoreUrl) } + func testLearnMoreUrl_MovieResaveStereo() { + let error = AppMediaStateError(code: "MOV_RESAVE_STEREO", description: "MOV_RESAVE_STEREO") + XCTAssertNotNil(error.learnMoreUrl) + } + + func testLearnMoreUrl_MovieResaveLonger() { + let error = AppMediaStateError(code: "MOV_RESAVE_LONGER", description: "MOV_RESAVE_LONGER") + XCTAssertNotNil(error.learnMoreUrl) + } + + func testLearnMoreUrl_MovieResaveTrim() { + let error = AppMediaStateError(code: "MOV_RESAVE_TRIM", description: "MOV_RESAVE_TRIM") + XCTAssertNotNil(error.learnMoreUrl) + } + func testLearnMoreUrl_Unknown() { let error = AppMediaStateError(code: "SOME_ERROR", description: "SOME_ERROR") XCTAssertNil(error.learnMoreUrl)