Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
precious-ossai-cko committed Jul 10, 2024
1 parent 464195c commit 457a94e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 90 deletions.
10 changes: 0 additions & 10 deletions Tests/Mocks/MockRisk.swift

This file was deleted.

82 changes: 2 additions & 80 deletions Tests/RiskTests/RiskTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,7 @@ import XCTest
@testable import Risk

class RiskTests: XCTestCase {

// func testGetInstanceWithValidConfiguration() {
// let expectation = self.expectation(description: "Risk instance creation")
//
// // TODO: Update CI to pass environment variable
// // guard let publicKey = ProcessInfo.processInfo.environment["SAMPLE_MERCHANT_PUBLIC_KEY"] else {
// // XCTFail("Environment variable SAMPLE_MERCHANT_PUBLIC_KEY is not set.")
// // return
// // }
// let publicKey = "dummy_key"
// let validConfig = RiskConfig(publicKey: publicKey, environment: RiskEnvironment.qa)
// let riskSDK = Risk(config: validConfig)
//
// riskSDK.configure { [weak self] result in
// guard let _ = self else { return }
//
// switch result {
// case .success:
// riskSDK.publishData { result in
// switch result {
// case .success(let response):
// XCTAssertNotNil(response.deviceSessionId)
// expectation.fulfill()
// case .failure:
// XCTFail("Risk data published failed")
// expectation.fulfill()
// }
// }
// case .failure(let error):
// XCTFail("Failed to configure Risk SDK with valid configuration: \(error)")
// }
// }
//
// waitForExpectations(timeout: 5, handler: nil)
// XCTAssertNotNil(riskSDK)
// }


func testGetInstanceWithInvalidPublicKey() {
let expectation = self.expectation(description: "Risk instance creation with invalid public key")

Expand All @@ -59,49 +23,7 @@ class RiskTests: XCTestCase {

waitForExpectations(timeout: 5, handler: nil)
}

// func testPublishTimeout() {
// let expectation = self.expectation(description: "Risk data timed out")
//
// let publicKey = "dummy_key"
// let validConfig = RiskConfig(publicKey: publicKey, environment: RiskEnvironment.qa)
//
//
//
// let riskSDK = Risk(config: validConfig)
//
// riskSDK.fingerprintTimeoutInterval = 0.01
//
// riskSDK.configure { [weak self] result in
// guard let _ = self else { return }
//
// switch result {
// case .success:
// let stubFingerprintService = MockFingerprintService()
// stubFingerprintService.delayTime = 0.1
//
// riskSDK.fingerprintService = stubFingerprintService
//
// riskSDK.publishData { result in
// switch result {
// case .success:
// XCTFail("Risk data published without timeout")
// expectation.fulfill()
// case .failure(let error):
// XCTAssertEqual(error, .fingerprintTimeout)
// expectation.fulfill()
// }
// }
// case .failure(let error):
// XCTFail("Failed to configure Risk SDK with valid configuration: \(error)")
// }
// }
//
// waitForExpectations(timeout: 5, handler: nil)
// }




func testPublishTimeout() {
verifyFingerprintTimeout(shouldTimeout: true, fingerprintTimeoutInterval: 0.01, delayTime: 0.1)
}
Expand Down

0 comments on commit 457a94e

Please sign in to comment.