-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vladimir Espinola
committed
Jul 11, 2024
1 parent
3eb8212
commit 4b119a3
Showing
5 changed files
with
152 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// ATTNAddToCartEventTests.swift | ||
// attentive-ios-sdk Tests | ||
// | ||
// Created by Vladimir - Work on 2024-07-11. | ||
// | ||
|
||
import XCTest | ||
@testable import ATTNSDKFramework | ||
|
||
final class ATTNAddToCartEventTests: XCTestCase { | ||
func testAddCart_GivenData_ShouldBuildURL() { | ||
let item = ATTNTestEventUtils.buildItem() | ||
let addToCart = ATTNAddToCartEvent(items: [item]) | ||
XCTAssertFalse(addToCart.eventRequests.isEmpty) | ||
XCTAssertNil(addToCart.eventRequests.first?.metadata["requestURL"]) | ||
} | ||
|
||
func testAddCart_GivenData_ShouldBuildURLWithRequestURL() { | ||
let item = ATTNTestEventUtils.buildItem() | ||
let addToCart = ATTNAddToCartEvent(items: [item]) | ||
addToCart.deeplink = "https://www.clientapp.com/flow=payment" | ||
XCTAssertFalse(addToCart.eventRequests.isEmpty) | ||
let requestURL = addToCart.eventRequests.first?.metadata["requestURL"] as? String | ||
XCTAssertNotNil(requestURL) | ||
XCTAssertFalse(requestURL?.isEmpty ?? true) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// ATTNProductViewEventTests.swift | ||
// attentive-ios-sdk Tests | ||
// | ||
// Created by Vladimir - Work on 2024-07-11. | ||
// | ||
|
||
import Foundation | ||
|
||
import XCTest | ||
@testable import ATTNSDKFramework | ||
|
||
final class ATTNProductViewEventTests: XCTestCase { | ||
func testProductView_GivenData_ShouldBuildURL() { | ||
let item = ATTNTestEventUtils.buildItem() | ||
let productView = ATTNProductViewEvent(items: [item]) | ||
XCTAssertFalse(productView.eventRequests.isEmpty) | ||
XCTAssertNil(productView.eventRequests.first?.metadata["requestURL"]) | ||
} | ||
|
||
func testProductView_GivenData_ShouldBuildURLWithRequestURL() { | ||
let item = ATTNTestEventUtils.buildItem() | ||
let productView = ATTNProductViewEvent(items: [item]) | ||
productView.deeplink = "https://www.clientapp.com/flow=payment" | ||
XCTAssertFalse(productView.eventRequests.isEmpty) | ||
let requestURL = productView.eventRequests.first?.metadata["requestURL"] as? String | ||
XCTAssertNotNil(requestURL) | ||
XCTAssertFalse(requestURL?.isEmpty ?? true) | ||
} | ||
} |
Oops, something went wrong.