@@ -16,28 +16,16 @@ final class WooConstantsTests: XCTestCase {
1616 }
1717 }
1818
19- func test_URLs_that_contains_special_characters_when_are_escaped_properly_then_do_not_return_nil ( ) throws {
19+ func test_URL_that_contains_special_characters_when_is_escaped_properly_then_does_not_return_nil ( ) throws {
2020 // Given
21- let urlsWithSpecialCharacters = [
22- WooConstants . URLs. inPersonPaymentsCashOnDeliveryFeedback,
23- WooConstants . URLs. inPersonPaymentsFirstTransactionFeedback,
24- WooConstants . URLs. inPersonPaymentsPowerUsersFeedback
25- ]
26-
27- let escapedURLsWithSpecialCharacters = [
28- " https://automattic.survey.fm/woo-app-%E2%80%93-cod-survey " ,
29- " https://automattic.survey.fm/woo-app-%E2%80%93-ipp-first-transaction-survey " ,
30- " https://automattic.survey.fm/woo-app-%E2%80%93-ipp-survey-for-power-users "
31- ]
21+ let urlStringWithSpecialCharacters = " https://test.com/test-–-survey "
22+ let escapedURLStringWithSpecialCharacter = " https://test.com/test-%E2%80%93-survey "
3223
3324 // When
34- let _ = urlsWithSpecialCharacters. map { trustedURL in
35- XCTAssertNotNil ( trustedURL)
36- }
25+ let trustedURL = try urlStringWithSpecialCharacters. asURL ( )
3726
3827 // Then
39- XCTAssertEqual ( urlsWithSpecialCharacters [ 0 ] . asURL ( ) . absoluteString, escapedURLsWithSpecialCharacters [ 0 ] )
40- XCTAssertEqual ( urlsWithSpecialCharacters [ 1 ] . asURL ( ) . absoluteString, escapedURLsWithSpecialCharacters [ 1 ] )
41- XCTAssertEqual ( urlsWithSpecialCharacters [ 2 ] . asURL ( ) . absoluteString, escapedURLsWithSpecialCharacters [ 2 ] )
28+ XCTAssertNotNil ( trustedURL)
29+ XCTAssertEqual ( trustedURL. absoluteString, escapedURLStringWithSpecialCharacter)
4230 }
4331}
0 commit comments