Skip to content

Commit

Permalink
Merge pull request #1196 from OneSignal/fix/operationRepoTestTypeError
Browse files Browse the repository at this point in the history
[Fix] Type Error in Operation Repo Tests
  • Loading branch information
shepherd-l authored Sep 24, 2024
2 parents 7ca28ca + 383b3c5 commit 5868c04
Showing 1 changed file with 10 additions and 0 deletions.
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

0 comments on commit 5868c04

Please sign in to comment.