Skip to content

Commit

Permalink
test: fix User removes consent
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtPooki committed Jul 12, 2023
1 parent dc52e2f commit 3b1cccd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/MetricsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default class MetricsProvider<T extends CountlyWebSdk | CountlyNodeSdk> {
* 1. we have a storage provider
* 2. we're out of the initialization phase.
*/
if (this.storageProvider != null && this.initDone) {
if (this.storageProvider != null) {
await this.storageProvider.setStore(Array.from(this._consentGranted))
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/node/NodeMetricsProvider.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describe('NodeMetricsProvider', function () {
await telemetry.removeConsent('minimal')
ensureCall({ spy: storageProviderStub.getStore, callCount: 1 }) // no change
ensureCall({ spy: countlyStub.remove_consent, callCount: 1, callIndex: 0, expectedArgs: ['minimal'] })
ensureCall({ spy: storageProviderStub.setStore, callCount: 2, callIndex: 0, expectedArgs: [] })
ensureCall({ spy: storageProviderStub.setStore, callCount: 2, callIndex: 1, expectedArgs: [] })
})
})
})

0 comments on commit 3b1cccd

Please sign in to comment.