Skip to content

Commit

Permalink
Tests updated
Browse files Browse the repository at this point in the history
  • Loading branch information
flypaper0 committed Sep 7, 2023
1 parent c174a8d commit aae4c63
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
4 changes: 3 additions & 1 deletion Example/IntegrationTests/Chat/ChatTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ final class ChatTests: XCTestCase {
let historyClient = HistoryClientFactory.create(
historyUrl: "https://history.walletconnect.com",
relayUrl: "wss://relay.walletconnect.com",
keychain: keychain
keyValueStorage: keyValueStorage,
keychain: keychain,
logger: logger
)

let clientId = try! networkingInteractor.getClientId()
Expand Down
8 changes: 5 additions & 3 deletions Example/IntegrationTests/History/HistoryTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ final class HistoryTests: XCTestCase {
override func setUp() {
let keychain1 = KeychainStorageMock()
let keychain2 = KeychainStorageMock()
let logger1 = ConsoleLoggerMock()
let defaults1 = RuntimeKeyValueStorage()
relayClient1 = makeRelayClient(prefix: "🐄", keychain: keychain1)
relayClient2 = makeRelayClient(prefix: "🐫", keychain: keychain2)
historyClient = makeHistoryClient(keychain: keychain1)
historyClient = makeHistoryClient(defaults: defaults1, keychain: keychain1, logger: logger1)
}

private func makeRelayClient(prefix: String, keychain: KeychainStorageProtocol) -> RelayClient {
Expand All @@ -33,8 +35,8 @@ final class HistoryTests: XCTestCase {
logger: ConsoleLogger(prefix: prefix + " [Relay]", loggingLevel: .debug))
}

private func makeHistoryClient(keychain: KeychainStorageProtocol) -> HistoryNetworkService {
let clientIdStorage = ClientIdStorage(keychain: keychain)
private func makeHistoryClient(defaults: KeyValueStorage, keychain: KeychainStorageProtocol, logger: ConsoleLogging) -> HistoryNetworkService {
let clientIdStorage = ClientIdStorage(defaults: defaults, keychain: keychain, logger: logger)
return HistoryNetworkService(clientIdStorage: clientIdStorage)
}

Expand Down
5 changes: 4 additions & 1 deletion Example/IntegrationTests/Pairing/PairingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@ final class PairingTests: XCTestCase {
let prefix = "🐶 Wallet: "
let (pairingClient, networkingInteractor, keychain, keyValueStorage) = makeClientDependencies(prefix: prefix)
let notifyLogger = ConsoleLogger(prefix: prefix + " [Notify]", loggingLevel: .debug)
let defaults = RuntimeKeyValueStorage()
walletPairingClient = pairingClient
let historyClient = HistoryClientFactory.create(
historyUrl: "https://history.walletconnect.com",
relayUrl: "wss://relay.walletconnect.com",
keychain: keychain
keyValueStorage: defaults,
keychain: keychain,
logger: notifyLogger
)
appAuthClient = AuthClientFactory.create(
metadata: AppMetadata(name: name, description: "", url: "", icons: [""]),
Expand Down
1 change: 1 addition & 0 deletions Example/IntegrationTests/Push/NotifyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ final class NotifyTests: XCTestCase {
walletPairingClient = pairingClient
let pushClient = PushClientFactory.create(projectId: "",
pushHost: "echo.walletconnect.com",
keyValueStorage: keyValueStorage,
keychainStorage: keychain,
environment: .sandbox)
let keyserverURL = URL(string: "https://keys.walletconnect.com")!
Expand Down
2 changes: 1 addition & 1 deletion Tests/RelayerTests/AuthTests/ClientIdStorageTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class ClientIdStorageTests: XCTestCase {

override func setUp() {
keychain = KeychainStorageMock()
sut = ClientIdStorage(keychain: keychain)
sut = ClientIdStorage(defaults: RuntimeKeyValueStorage(), keychain: keychain, logger: ConsoleLoggerMock())
}

func testGetOrCreate() throws {
Expand Down

0 comments on commit aae4c63

Please sign in to comment.