Skip to content

[MOB-7936] create iterable embedded placement class #636

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

Closed
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d83d2ec
feat: adds constructor and messages list to IterableEmbeddedPlacement
May 23, 2025
6a63bbd
feat: adds constructor to IterableEmbeddedMessage
May 23, 2025
b78f8e0
feat: adds IterableEmbeddedMessageMetadata class
May 24, 2025
0bb9997
feat: adds unit tests for IterableMessageMetadata
May 24, 2025
ac62585
feat: adds comments to IterableEmbeddedMessageMetadata
May 24, 2025
626a256
feat: adds IterableEmbeddedMessageElements class
May 24, 2025
aacfeae
feat: adds IterableEmbeddedMessageDefaultAction and associated tests
May 27, 2025
78c92f8
feat: adds docs to IterableEmbeddedMessageDefaultAction
May 27, 2025
023ed30
feat: adds IterableEmbeddedMessageText class
May 27, 2025
0d4b4b3
feat: adds unit tests for IterableEmbeddedMessageText
May 27, 2025
c30f78a
feat: adds unit tests for IterableEmbeddedMessageText
May 27, 2025
1ce1e39
feat: adds IterableEmbeddedMessageButton class
May 27, 2025
547377c
feat: adds unit tests for IterableEmbeddedMessageButton
May 27, 2025
76ef3b9
feat: adds IterableEmbeddedMessageElements class
May 27, 2025
a07277f
feat: adds unit tests for IterableEmbeddedMessageElements
May 27, 2025
1e2a3a9
feat: adds dictionary processing to IterableEmbeddedPlacement and Ite…
May 27, 2025
9ce071e
feat: adds unit tests for IterableEmbeddedMessage
May 27, 2025
ee001de
feat: adds unit tests for IterableEmbeddedPlacement
May 27, 2025
f361566
Merge branch 'evan/MOB-8751-create-embedded-manager' into evan/MOB-79…
evantk91 May 27, 2025
ad0ee83
Merge branch 'evan/MOB-8751-create-embedded-manager' into evan/MOB-79…
evantk91 Jun 3, 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
58 changes: 58 additions & 0 deletions src/__tests__/IterableEmbeddedMesageMetadata.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { IterableEmbeddedMessageMetadata } from '../embedded/classes/IterableEmbeddedMessageMetadata';

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

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

describe('IterableEmbeddedMessage', () => {
test('should create an instance of IterableEmbeddedMessageMetadata from a dictionary', () => {
Iterable.logger.log(
'iterableEmbeddedMessageMetadata_fromDict_valid_dictionary'
);

const dict = {
messageId: '123',
placementId: 456,
campaignId: 789,
isProof: false,
};

const result = IterableEmbeddedMessageMetadata.fromDict(dict);

expect(result).toBeInstanceOf(IterableEmbeddedMessageMetadata);
expect(result.messageId).toBe('123');
expect(result.placementId).toBe(456);
expect(result.campaignId).toBe(789);
expect(result.isProof).toBe(false);
});

test('should handle optional fields', () => {
Iterable.logger.log(
'iterableEmbeddedMessageMetadata_fromDict_optional_fields_omitted'
);

const dict = {
messageId: '123',
placementId: 456,
};

const result = IterableEmbeddedMessageMetadata.fromDict(dict);

expect(result).toBeInstanceOf(IterableEmbeddedMessageMetadata);
expect(result.messageId).toBe('123');
expect(result.placementId).toBe(456);
expect(result.campaignId).toBeUndefined();
expect(result.isProof).toBe(false);
});

test('should throw an error if messageId is not provided', () => {
Iterable.logger.log(
'iterableEmbeddedMessageMetadata_fromDict_missing_messageId'
);

const dict = {
placementId: 456,
};

expect(() => {
IterableEmbeddedMessageMetadata.fromDict(dict);
}).toThrow('messageId and placementId are required');
});
});
163 changes: 163 additions & 0 deletions src/__tests__/IterableEmbeddedMessage.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
import { IterableEmbeddedMessage } from '../embedded/classes/IterableEmbeddedMessage';

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

import { IterableEmbeddedMessageMetadata } from '../embedded/classes/IterableEmbeddedMessageMetadata';
import { IterableEmbeddedMessageElements } from '../embedded/classes/IterableEmbeddedMessageElements';
import { Iterable } from '../core/classes/Iterable';

describe('IterableEmbeddedMessage', () => {
it('should create an instance with all properties', () => {
Iterable.logger.log('iterableEmbeddedMessage_fromDict_all_properties');

const dict = {
metadata: {
messageId: 'msg-123',
placementId: 1,
campaignId: 456,
isProof: false,
},
elements: {
title: 'Awesome Title',
body: 'Radical Body Text',
mediaUrl: 'https://example.com/image.jpg',
mediaUrlCaption: 'Check out this sick image!',
defaultAction: {
type: 'openUrl',
data: 'https://example.com',
},
buttons: [
{
id: 'button-1',
title: 'Click Me!',
action: {
type: 'openUrl',
data: 'https://example.com/button1',
},
},
],
text: [
{
id: 'text-1',
text: 'Some cool text',
type: 'body',
},
],
},
payload: {
customKey: 'customValue',
anotherKey: 123,
},
};

const message = IterableEmbeddedMessage.fromDict(dict);

expect(message).toBeInstanceOf(IterableEmbeddedMessage);

// Check metadata
expect(message.metadata).toBeInstanceOf(IterableEmbeddedMessageMetadata);
expect(message.metadata.messageId).toBe('msg-123');
expect(message.metadata.placementId).toBe(1);
expect(message.metadata.campaignId).toBe(456);
expect(message.metadata.isProof).toBe(false);

// Check elements
expect(message.elements).toBeInstanceOf(IterableEmbeddedMessageElements);
expect(message.elements?.title).toBe('Awesome Title');
expect(message.elements?.body).toBe('Radical Body Text');
expect(message.elements?.mediaUrl).toBe('https://example.com/image.jpg');
expect(message.elements?.mediaUrlCaption).toBe(
'Check out this sick image!'
);

// Check payload
expect(message.payload).toEqual({
customKey: 'customValue',
anotherKey: 123,
});
});

it('should create an instance with only required metadata', () => {
Iterable.logger.log('iterableEmbeddedMessage_fromDict_required_only');

const dict = {
metadata: {
messageId: 'msg-123',
placementId: 1,
isProof: false,
},
};

const message = IterableEmbeddedMessage.fromDict(dict);

expect(message).toBeInstanceOf(IterableEmbeddedMessage);
expect(message.metadata).toBeInstanceOf(IterableEmbeddedMessageMetadata);
expect(message.metadata.messageId).toBe('msg-123');
expect(message.metadata.placementId).toBe(1);
expect(message.metadata.campaignId).toBeUndefined();
expect(message.metadata.isProof).toBe(false);
expect(message.elements).toBeUndefined();
expect(message.payload).toBeUndefined();
});

it('should throw an error if metadata is missing', () => {
Iterable.logger.log('iterableEmbeddedMessage_fromDict_missing_metadata');

const dict = {
elements: {
title: 'Some Title',
body: 'Some Body',
},
};

expect(() => IterableEmbeddedMessage.fromDict(dict)).toThrow(
'metadata is required'
);
});

it('should create an instance with elements but no payload', () => {
Iterable.logger.log('iterableEmbeddedMessage_fromDict_elements_only');

const dict = {
metadata: {
messageId: 'msg-123',
placementId: 1,
isProof: false,
},
elements: {
title: 'Elements Only',
body: 'No payload here',
},
};

const message = IterableEmbeddedMessage.fromDict(dict);

expect(message).toBeInstanceOf(IterableEmbeddedMessage);
expect(message.metadata).toBeInstanceOf(IterableEmbeddedMessageMetadata);
expect(message.elements).toBeInstanceOf(IterableEmbeddedMessageElements);
expect(message.elements?.title).toBe('Elements Only');
expect(message.elements?.body).toBe('No payload here');
expect(message.payload).toBeUndefined();
});

it('should create an instance with payload but no elements', () => {
Iterable.logger.log('iterableEmbeddedMessage_fromDict_payload_only');

const dict = {
metadata: {
messageId: 'msg-123',
placementId: 1,
isProof: false,
},
payload: {
someData: 'someValue',
},
};

const message = IterableEmbeddedMessage.fromDict(dict);

expect(message).toBeInstanceOf(IterableEmbeddedMessage);
expect(message.metadata).toBeInstanceOf(IterableEmbeddedMessageMetadata);
expect(message.elements).toBeUndefined();
expect(message.payload).toEqual({
someData: 'someValue',
});
});
});
91 changes: 91 additions & 0 deletions src/__tests__/IterableEmbeddedMessageButton.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import { IterableEmbeddedMessageButton } from '../embedded/classes/IterableEmbeddedMessageButton';

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

import { IterableEmbeddedMessageElementsButtonAction } from '../embedded/classes/IterableEmbeddedMessageElementsButtonAction';
import { Iterable } from '../core/classes/Iterable';

describe('IterableEmbeddedMessageButton', () => {
it('should create an instance with all properties including button action', () => {
Iterable.logger.log(
'iterableEmbeddedMessageButton_fromDict_all_properties'
);

const dict = {
id: 'button-123',
title: 'Click Me!',
action: { type: 'openUrl', data: 'https://example.com' },
};

const button = IterableEmbeddedMessageButton.fromDict(dict);

expect(button).toBeInstanceOf(IterableEmbeddedMessageButton);
expect(button.id).toBe('button-123');
expect(button.title).toBe('Click Me!');
expect(button.action).toBeInstanceOf(
IterableEmbeddedMessageElementsButtonAction
);
expect(button.action?.type).toBe('openUrl');
expect(button.action?.data).toBe('https://example.com');
});

it('should create an instance with only required properties', () => {
Iterable.logger.log('iterableEmbeddedMessageButton_fromDict_required_only');

const dict = { id: 'button-123' };

const button = IterableEmbeddedMessageButton.fromDict(dict);

expect(button).toBeInstanceOf(IterableEmbeddedMessageButton);
expect(button.id).toBe('button-123');
expect(button.title).toBeUndefined();
expect(button.action).toBeUndefined();
});

it('should create an instance with title but no action', () => {
Iterable.logger.log('iterableEmbeddedMessageButton_fromDict_title_only');

const dict = {
id: 'button-123',
title: 'Click Me!',
};

const button = IterableEmbeddedMessageButton.fromDict(dict);

expect(button).toBeInstanceOf(IterableEmbeddedMessageButton);
expect(button.id).toBe('button-123');
expect(button.title).toBe('Click Me!');
expect(button.action).toBeUndefined();
});

it('should throw an error if id is missing in fromDict', () => {
Iterable.logger.log('iterableEmbeddedMessageButton_fromDict_missing_id');

const dict = {
title: 'Click Me!',
action: { type: 'openUrl', data: 'https://example.com' },
};

expect(() => IterableEmbeddedMessageButton.fromDict(dict)).toThrow(
'id is required'
);
});

it('should handle button action with only type', () => {
Iterable.logger.log(
'iterableEmbeddedMessageButton_fromDict_action_type_only'
);

const dict = {
id: 'button-123',
action: { type: 'close' },
};

const button = IterableEmbeddedMessageButton.fromDict(dict);

expect(button).toBeInstanceOf(IterableEmbeddedMessageButton);
expect(button.id).toBe('button-123');
expect(button.action).toBeInstanceOf(
IterableEmbeddedMessageElementsButtonAction
);
expect(button.action?.type).toBe('close');
expect(button.action?.data).toBeUndefined();
});
});
40 changes: 40 additions & 0 deletions src/__tests__/IterableEmbeddedMessageDefaultAction.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { IterableEmbeddedMessageDefaultAction } from '../embedded/classes/IterableEmbeddedMessageDefaultAction';

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

Choose a reason for hiding this comment

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

Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
[eslint:tsdoc/syntax]

import { Iterable } from '../core/classes/Iterable';

describe('IterableEmbeddedMessageDefaultAction', () => {
it('should create an instance with the correct properties', () => {
Iterable.logger.log(
'iterableEmbeddedMessageDefaultAction_fromDict_valid_dictionary'
);

const dict = { type: 'openUrl', data: 'https://example.com' };
const action = IterableEmbeddedMessageDefaultAction.fromDict(dict);
expect(action).toBeInstanceOf(IterableEmbeddedMessageDefaultAction);
expect(action.type).toBe('openUrl');
expect(action.data).toBe('https://example.com');
});

it('should create an instance from a dictionary with data omitted', () => {
Iterable.logger.log(
'iterableEmbeddedMessageDefaultAction_fromDict_valid_dictionary_with_data_omitted'
);

const dict = { type: 'action://join', data: '' };
const action = IterableEmbeddedMessageDefaultAction.fromDict(dict);
expect(action).toBeInstanceOf(IterableEmbeddedMessageDefaultAction);
expect(action.type).toBe('action://join');
expect(action.data).toBe('');
});

it('should throw an error if type is missing in fromDict', () => {
Iterable.logger.log(
'iterableEmbeddedMessageDefaultAction_fromDict_invalid_dictionary_missing_type'
);

const dict = { data: 'foo' };

expect(() => IterableEmbeddedMessageDefaultAction.fromDict(dict)).toThrow(
'type is required'
);
});
});
Loading