Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Type Error in Operation Repo Tests #1196

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions __test__/unit/core/operationRepo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
DELTA_QUEUE_TIME_ADVANCE,
DUMMY_MODEL_ID,
DUMMY_ONESIGNAL_ID,
DUMMY_PUSH_TOKEN,
} from '../../support/constants';
import ModelCache from '../../../src/core/caching/ModelCache';
import ExecutorBase from '../../../src/core/executors/ExecutorBase';
Expand All @@ -22,6 +23,7 @@ import {
} from '../../support/helpers/core';
import { TestEnvironment } from '../../support/environment/TestEnvironment';
import { Operation } from '../../../src/core/operationRepo/Operation';
import Database from '../../../src/shared/services/Database';

let broadcastCount = 0;

Expand Down Expand Up @@ -198,6 +200,14 @@ describe('OperationRepo tests', () => {
test('Update User Properties: -> one operation of change type: update', (done: jest.DoneCallback) => {
test.stub(Operation, 'getInstanceWithModelReference');

test.stub(
Database,
'getAppState',
Promise.resolve({
lastKnownPushToken: DUMMY_PUSH_TOKEN,
}),
);

const { modelRepo, operationRepo } = OneSignal.coreDirector.core;
const executor = operationRepo?.executorStore.store[ModelName.Properties];

Expand Down
Loading