From 06408c0e031989362e77b9a44bc03ebfc211ed5f Mon Sep 17 00:00:00 2001 From: Artur Guseinov Date: Wed, 11 Oct 2023 20:03:55 +0800 Subject: [PATCH] testNotifyWatchSubscriptions sleep and task removed --- Example/IntegrationTests/Push/NotifyTests.swift | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Example/IntegrationTests/Push/NotifyTests.swift b/Example/IntegrationTests/Push/NotifyTests.swift index 67f2aa889..e35cd221b 100644 --- a/Example/IntegrationTests/Push/NotifyTests.swift +++ b/Example/IntegrationTests/Push/NotifyTests.swift @@ -115,22 +115,20 @@ final class NotifyTests: XCTestCase { let clientB = makeWalletClient(prefix: "👐🏼 Wallet B: ") clientB.subscriptionsPublisher.sink { subscriptions in - Task(priority: .high) { - if !subscriptions.isEmpty { - expectation.fulfill() - } + if !subscriptions.isEmpty { + expectation.fulfill() } }.store(in: &publishers) try! await walletNotifyClientA.register(account: account, domain: gmDappDomain, onSign: sign) try! await walletNotifyClientA.subscribe(appDomain: gmDappDomain, account: account) - sleep(1) try! await clientB.register(account: account, domain: gmDappDomain, onSign: sign) wait(for: [expectation], timeout: InputConfig.defaultTimeout) } + func testNotifySubscriptionChanged() async throws { let expectation = expectation(description: "expects client B to receive subscription after both clients are registered and client A creates one") expectation.assertForOverFulfill = false