Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 4 additions & 2 deletions app/__mocks__/react-native-video.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React from 'react';
import { View } from 'react-native';

const VideoMock = ({ testID }: { testID?: string }) => (
<View testID={testID ?? 'mock-video'} />
type VideoMockProps = { testID?: string } & Record<string, unknown>;

const VideoMock = ({ testID, ...rest }: VideoMockProps) => (
<View testID={testID ?? 'mock-video'} {...rest} />
);

VideoMock.displayName = 'VideoMock';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,24 @@ describe('MarketInsightsView', () => {
expect(queryByTestId(MarketInsightsSelectorsIDs.VIEW_CONTAINER)).toBeNull();
});

it('configures background video to mix with other audio', () => {
mockUseMarketInsights.mockReturnValue({
report: buildMockReport(),
isLoading: false,
error: null,
timeAgo: '5m ago',
});

const { getByTestId } = renderWithProvider(<MarketInsightsView />);

const backgroundVideo = getByTestId(
MarketInsightsSelectorsIDs.BACKGROUND_ANIMATION,
);

expect(backgroundVideo.props.ignoreSilentSwitch).toBe('obey');
expect(backgroundVideo.props.mixWithOthers).toBe('mix');
});

it('renders report content and handles tweet/swap/buy actions', () => {
mockUseMarketInsights.mockReturnValue({
report: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,8 @@ const MarketInsightsView: React.FC = () => {
paused={false}
controls={false}
disableFocus
ignoreSilentSwitch="obey"
mixWithOthers="mix"
onEnd={handleVideoEnd}
testID={MarketInsightsSelectorsIDs.BACKGROUND_ANIMATION}
/>
Expand Down
Loading