@@ -130,9 +130,7 @@ struct RemoteInterfaceExtensionTests {
130130 }
131131
132132 // 1. Simulate an external process starting a fetch for testAccount
133- await RetrievedCapabilitiesActor . shared. setOngoingFetch (
134- forAccount: testAccount. ncKitAccount, ongoing: true
135- )
133+ await RetrievedCapabilitiesActor . shared. setOngoingFetch ( forAccount: testAccount. ncKitAccount, ongoing: true )
136134
137135 await confirmation ( " currentCapabilitiesReturned " ) { currentCapabilitiesReturned in
138136 let currentCapabilitiesTask = Task { @Sendable in
@@ -144,17 +142,17 @@ struct RemoteInterfaceExtensionTests {
144142 #expect( result. error == . success)
145143 }
146144
147- await currentCapabilitiesTask. value
148- }
145+ // 3. Now, the "external" fetch completes and populates the cache.
146+ await RetrievedCapabilitiesActor . shared. setCapabilities (
147+ forAccount: testAccount. ncKitAccount,
148+ capabilities: cachedCaps,
149+ retrievedAt: Date ( ) // Fresh date
150+ )
149151
150- // 4. Now, the "external" fetch completes and populates the cache.
151- await RetrievedCapabilitiesActor . shared. setCapabilities (
152- forAccount: testAccount. ncKitAccount,
153- capabilities: cachedCaps,
154- retrievedAt: Date ( ) // Fresh date
155- )
152+ await RetrievedCapabilitiesActor . shared. setOngoingFetch ( forAccount: testAccount. ncKitAccount, ongoing: false )
156153
157- await RetrievedCapabilitiesActor . shared. setOngoingFetch ( forAccount: testAccount. ncKitAccount, ongoing: false )
154+ await currentCapabilitiesTask. value
155+ }
158156 }
159157
160158 @Test func supportsTrashTrue( ) async throws {
0 commit comments