diff --git a/app/actions/remote/entry/common.test.ts b/app/actions/remote/entry/common.test.ts index 71b5128d1..1b71b8236 100644 --- a/app/actions/remote/entry/common.test.ts +++ b/app/actions/remote/entry/common.test.ts @@ -22,6 +22,7 @@ import NetworkManager from '@managers/network_manager'; import {getDeviceToken} from '@queries/app/global'; import {getCurrentChannelId, getCurrentTeamId, setCurrentTeamAndChannelId} from '@queries/servers/system'; import NavigationStore from '@store/navigation_store'; +import {logDebug} from '@utils/log'; import {entry, setExtraSessionProps, verifyPushProxy, entryInitialChannelId, restDeferredAppEntryActions, handleEntryAfterLoadNavigation, deferredAppEntryActions} from './common'; @@ -866,7 +867,6 @@ describe('actions/remote/entry/common', () => { }); it('should handle error gracefully', async () => { - const consoleDebugSpy = jest.spyOn(console, 'debug').mockImplementation(() => {}); (DatabaseManager.getServerDatabaseAndOperator as jest.Mock).mockImplementation(() => { throw new Error('Test error'); }); @@ -882,8 +882,7 @@ describe('actions/remote/entry/common', () => { false, ); - expect(consoleDebugSpy).toHaveBeenCalled(); - consoleDebugSpy.mockRestore(); + expect(logDebug).toHaveBeenCalled(); }); it('should handle tablet device scenario', async () => { diff --git a/app/components/button/index.test.tsx b/app/components/button/index.test.tsx new file mode 100644 index 000000000..42f7a3ec6 --- /dev/null +++ b/app/components/button/index.test.tsx @@ -0,0 +1,85 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +import {fireEvent, render, within} from '@testing-library/react-native'; +import React, {type ComponentProps} from 'react'; +import {View, Text} from 'react-native'; + +import {Preferences} from '@constants'; + +import Button from './index'; + +describe('components/button', () => { + const getBaseProps = (): ComponentProps => ({ + onPress: jest.fn(), + text: 'Test Button', + theme: Preferences.THEMES.denim, + testID: 'test-button', + }); + + it('should render button with text', () => { + const props = getBaseProps(); + const {getByText} = render(