Skip to content

Commit

Permalink
test(in-app-messaging): ensure modular API are exported properly (#7936)
Browse files Browse the repository at this point in the history
  • Loading branch information
russellwheatley authored Jul 30, 2024
1 parent 4460536 commit 3223792
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
46 changes: 46 additions & 0 deletions packages/in-app-messaging/__tests__/inappmessaging.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { describe, expect, it } from '@jest/globals';

import {
firebase,
getInAppMessaging,
isMessagesDisplaySuppressed,
setMessagesDisplaySuppressed,
isAutomaticDataCollectionEnabled,
setAutomaticDataCollectionEnabled,
triggerEvent,
} from '../lib';

describe('in-app-messaging', function () {
describe('namespace', function () {
it('accessible from firebase.app()', function () {
const app = firebase.app();
expect(app.inAppMessaging).toBeDefined();
});
});

describe('modular', function () {
it('`getInAppMessaging` function is properly exposed to end user', function () {
expect(getInAppMessaging).toBeDefined();
});

it('`isMessagesDisplaySuppressed` function is properly exposed to end user', function () {
expect(isMessagesDisplaySuppressed).toBeDefined();
});

it('`setMessagesDisplaySuppressed` function is properly exposed to end user', function () {
expect(setMessagesDisplaySuppressed).toBeDefined();
});

it('`isAutomaticDataCollectionEnabled` function is properly exposed to end user', function () {
expect(isAutomaticDataCollectionEnabled).toBeDefined();
});

it('`setAutomaticDataCollectionEnabled` function is properly exposed to end user', function () {
expect(setAutomaticDataCollectionEnabled).toBeDefined();
});

it('`triggerEvent` function is properly exposed to end user', function () {
expect(triggerEvent).toBeDefined();
});
});
});
2 changes: 2 additions & 0 deletions packages/in-app-messaging/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ export const firebase: ReactNativeFirebase.Module & {

export default defaultExport;

export * from './modular';

/**
* Attach namespace to `firebase.` and `FirebaseApp.`.
*/
Expand Down

0 comments on commit 3223792

Please sign in to comment.