From 5fd35dd1409f601ef1e798a970c79ad63c0a39d7 Mon Sep 17 00:00:00 2001 From: Josh Kasten Date: Thu, 23 Nov 2023 04:59:28 +0000 Subject: [PATCH] remove onSession HTTP test --- test/unit/public-sdk-apis/onSession.ts | 52 -------------------------- 1 file changed, 52 deletions(-) diff --git a/test/unit/public-sdk-apis/onSession.ts b/test/unit/public-sdk-apis/onSession.ts index 379857be8..6c8b92b02 100644 --- a/test/unit/public-sdk-apis/onSession.ts +++ b/test/unit/public-sdk-apis/onSession.ts @@ -11,13 +11,11 @@ import { NotificationPermission } from '../../../src/shared/models/NotificationP import { UpdateManager } from '../../../src/shared/managers/UpdateManager'; import { PageViewManager } from '../../../src/shared/managers/PageViewManager'; import { SubscriptionManager } from '../../../src/shared/managers/SubscriptionManager'; -import InitHelper from '../../../src/shared/helpers/InitHelper'; import { markUserAsOptedOut, markUserAsSubscribed, stubServiceWorkerInstallation, } from '../../support/tester/sinonSandboxUtils'; -import { createSubscription } from '../../support/tester/utils'; import EventsTestHelper from '../../support/tester/EventsTestHelper'; import { DelayedPromptType } from '../../../src/shared/models/Prompts'; @@ -514,56 +512,6 @@ test.serial( }, ); -test.serial( - `HTTP: User not subscribed and not opted out => first page view => slidedown's autoPrompt is on => - click allow => sends player create`, - async (t) => { - const testConfig: TestEnvironmentConfig = { - integration: ConfigIntegrationKind.Custom, - pushIdentifier: 'granted', - stubSetTimeout: true, - }; - const stubs = await TestEnvironment.setupOneSignalPageWithStubs( - sinonSandbox, - testConfig, - t, - ); - - const eventsHelper = new EventsTestHelper(sinonSandbox); - EventsTestHelper.simulateSlidedownAllowAfterShown(); - eventsHelper.simulateSubscribingAfterNativeAllow(); - - const initializePromise = new Promise((resolve) => { - OneSignal.on(OneSignal.EVENTS.SDK_INITIALIZED_PUBLIC, () => { - t.is(stubs.onSessionStub.callCount, 0); - t.is(stubs.createPlayerPostStub.callCount, 0); - resolve(); - }); - }); - - const subscriptionPromise = new Promise((resolve) => { - OneSignal.on(OneSignal.EVENTS.SUBSCRIPTION_CHANGED, () => { - t.is(stubs.onSessionStub.callCount, 1); - t.is(stubs.createPlayerPostStub.callCount, 1); - inspectPushRecordCreationRequest(t, stubs.createPlayerPostStub); - resolve(); - }); - }); - - const initPromise = OneSignal.init({ - appId, - promptOptions: { - slidedown: defaultSlidedownOptions, - }, - autoResubscribe: false, - }); - await initPromise; - t.is(OneSignal.context.pageViewManager.getPageViewCount(), 1); - await initializePromise; - await subscriptionPromise; - }, -); - /** Helper methods */ async function inspectPushRecordCreationRequest( t: ExecutionContext,