Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Adds test
  • Loading branch information
antonis committed Jan 27, 2025
commit a5a3fb486adf829dc2c80164ae37cc94017942d9
20 changes: 20 additions & 0 deletions packages/core/test/feedback/FeedbackFormManager.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as React from 'react';
import { Text } from 'react-native';

import { FeedbackFormProvider, showFeedbackForm } from '../../src/js/feedback/FeedbackFormManager';
import { feedbackIntegration } from '../../src/js/feedback/integration';

jest.mock('../../src/js/feedback/utils', () => ({
isModalSupported: jest.fn(),
Expand Down Expand Up @@ -50,4 +51,23 @@ describe('FeedbackFormManager', () => {
showFeedbackForm();
}).not.toThrow();
});

it('showFeedbackForm displays the form with the feedbackIntegration options', () => {
require('../../src/js/feedback/utils').isModalSupported.mockReturnValue(true);
const { getByPlaceholderText, getByText } = render(
<FeedbackFormProvider>
<Text>App Components</Text>
</FeedbackFormProvider>
);

feedbackIntegration({
messagePlaceholder: 'Custom Message Placeholder',
submitButtonLabel: 'Custom Submit Button',
});

showFeedbackForm();

expect(getByPlaceholderText('Custom Message Placeholder')).toBeTruthy();
expect(getByText('Custom Submit Button')).toBeTruthy();
});
});
Loading