Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e78a6ea
feat: refactor Iterable class and introduce IterableApi for improved …
lposen Oct 7, 2025
1ff7740
feat: add authManager to Iterable class
lposen Oct 7, 2025
1a8fa41
refactor: replace RNIterableAPI calls with IterableApi methods
lposen Oct 7, 2025
72d066a
docs: replace RNIterableAPI with IterableApi in IterableInAppManager
lposen Oct 7, 2025
510c581
refactor: integrate IterableApi methods in IterableInboxDataModel
lposen Oct 7, 2025
564bcbd
docs: enhance IterableApi documentation with detailed method descript…
lposen Oct 7, 2025
8aa92c1
Merge branch 'jwt/MOB-11032-task-4-ios-bridge-retrypolicy-and-authfai…
lposen Oct 9, 2025
2e9d116
Merge branch 'jwt/MOB-11032-task-4-ios-bridge-retrypolicy-and-authfai…
lposen Oct 9, 2025
a9f46c1
refactor: remove default constants module and instantiate defaults di…
lposen Oct 9, 2025
01c7919
refactor: instantiate IterableInAppManager and IterableAuthManager di…
lposen Oct 9, 2025
382164d
refactor: remove circular dependency comments in Iterable class
lposen Oct 9, 2025
a7ff561
chore: add circular dependency check script to package.json
lposen Oct 9, 2025
eb2c376
refactor: remove unnecessary type-only import to simplify Iterable class
lposen Oct 10, 2025
b10097a
refactor: streamline logging by removing logger instances and using s…
lposen Oct 10, 2025
b776414
test: add comprehensive tests for IterableLogger class, addressing lo…
lposen Oct 10, 2025
65cb551
feat: add authentication manager to Iterable class
lposen Oct 10, 2025
5bbb5fc
refactor: remove pauseAuthRetries method from Iterable class
lposen Oct 10, 2025
92fbff1
chore: disable TSDoc syntax rule for IterableRetryBackoff enum
lposen Oct 10, 2025
e94100f
feat: add pauseAuthRetries method to authentication manager and enhan…
lposen Oct 10, 2025
5e4e579
Merge branch 'jwt/MOB-10946-task-2-authfailure-and-retrypolicy-ts-cla…
lposen Oct 10, 2025
3737d57
fix: improve null safety in IterableInAppMessage.fromViewToken method
lposen Oct 10, 2025
2d6c381
Merge branch 'jwt/MOB-10947-task-3-android-retrypolicy-config-at-andr…
lposen Oct 10, 2025
c6b62d0
refactor: remove instantiation of IterableInAppManager and IterableAu…
lposen Oct 10, 2025
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
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
root: true,
ignorePatterns: ['coverage/**/*'],
extends: [
'@react-native',
'plugin:react/recommended',
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"prebuild": "yarn add_build_info",
"build": "yarn add_build_info && yarn bob build",
"prepare": "yarn build",
"release": "release-it"
"release": "release-it",
"circ": "npx madge --circular --extensions ts ./"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a dedicated package to results circular dependency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup!

},
"keywords": [
"react-native",
Expand Down
4 changes: 3 additions & 1 deletion src/__mocks__/MockRNIterableAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ export class MockRNIterableAPI {

static initialize2WithApiKey = jest.fn().mockResolvedValue(true);

static wakeApp = jest.fn()
static wakeApp = jest.fn();

static setInAppShowResponse = jest.fn();

static passAlongAuthToken = jest.fn();

static pauseAuthRetries = jest.fn();

static async getInAppMessages(): Promise<IterableInAppMessage[] | undefined> {
return await new Promise((resolve) => {
resolve(MockRNIterableAPI.messages);
Expand Down
19 changes: 10 additions & 9 deletions src/__tests__/IterableInApp.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { NativeEventEmitter } from 'react-native';

import { IterableLogger } from '../core';

import { MockRNIterableAPI } from '../__mocks__/MockRNIterableAPI';

import {
Expand All @@ -21,7 +19,6 @@ import {
describe('Iterable In App', () => {
beforeEach(() => {
jest.clearAllMocks();
Iterable.logger = new IterableLogger(new IterableConfig());
});

test('trackInAppOpen_params_methodCalledWithParams', () => {
Expand Down Expand Up @@ -202,9 +199,11 @@ describe('Iterable In App', () => {
// WHEN the simulated local queue is set to the in-app messages
MockRNIterableAPI.setMessages(messages);
// THEN Iterable.inAppManager.getMessages returns the list of in-app messages
return await Iterable.inAppManager?.getMessages().then((messagesObtained) => {
expect(messagesObtained).toEqual(messages);
});
return await Iterable.inAppManager
?.getMessages()
.then((messagesObtained) => {
expect(messagesObtained).toEqual(messages);
});
});

test('showMessage_messageAndConsume_returnsClickedUrl', async () => {
Expand All @@ -222,9 +221,11 @@ describe('Iterable In App', () => {
// WHEN the simulated clicked url is set to the clicked url
MockRNIterableAPI.setClickedUrl(clickedUrl);
// THEN Iterable,inAppManager.showMessage returns the simulated clicked url
return await Iterable.inAppManager?.showMessage(message, consume).then((url) => {
expect(url).toEqual(clickedUrl);
});
return await Iterable.inAppManager
?.showMessage(message, consume)
.then((url) => {
expect(url).toEqual(clickedUrl);
});
});

test('removeMessage_params_methodCalledWithParams', () => {
Expand Down
Loading