~ knotless Search/
↑↓ move↵ open⇧↵ all results

geesawra.industries/hydraulophone

An unofficial YouTube Music app for iPhone, iPad, and Mac.

0
0
main
34 lines · 914 B Raw History
import Foundation
import XCTest

@testable import Hydraulophone

@MainActor
final class PlaybackArtworkPublisherTests: XCTestCase {
  func testArtworkFromObsoleteTrackCannotReplaceCurrentTrackArtwork() throws {
    let firstURL = try XCTUnwrap(URL(string: "https://example.invalid/first.jpg"))
    let secondURL = try XCTUnwrap(URL(string: "https://example.invalid/second.jpg"))

    XCTAssertFalse(
      NativeNowPlayingPublisher.shouldApplyArtwork(
        requestedURL: firstURL,
        currentURL: secondURL,
        isCancelled: false
      )
    )
    XCTAssertFalse(
      NativeNowPlayingPublisher.shouldApplyArtwork(
        requestedURL: secondURL,
        currentURL: secondURL,
        isCancelled: true
      )
    )
    XCTAssertTrue(
      NativeNowPlayingPublisher.shouldApplyArtwork(
        requestedURL: secondURL,
        currentURL: secondURL,
        isCancelled: false
      )
    )
  }
}