Skip to content

Commit 8c54449

Browse files
Unit tests for URL site info tagging.
1 parent 882701a commit 8c54449

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

WooCommerce/WooCommerceTests/ViewRelated/Survey/URL+SurveyViewControllerTests.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,18 @@ final class URL_SurveyViewControllerTests: XCTestCase {
2222

2323
XCTAssertEqual(expectedURL, actualURL)
2424
}
25+
26+
func test_tagging_site_info_appends_the_correct_tag_data() throws {
27+
let siteID: Int64 = 123
28+
let testURL = "https://example.com"
29+
let storeUUID = "8363cd24-2501-463f-b21b-649315a0d507"
30+
31+
let expectedURL = "https://testurl.com?site-id=\(siteID)&store-id=\(storeUUID)&store-url=\(testURL)"
32+
33+
let actualURL = URL(string: "https://testurl.com")?.tagSiteInfo(siteID: siteID,
34+
storeUUID: storeUUID,
35+
storeURL: testURL).absoluteString
36+
37+
XCTAssertEqual(expectedURL, actualURL)
38+
}
2539
}

0 commit comments

Comments
 (0)