11import { act , fireEvent , render , screen } from '@testing-library/react' ;
22import { MemoryRouter } from 'react-router-dom' ;
33import { mockAuth , mockSettings } from '../__mocks__/state-mocks' ;
4- import { mockPlatform } from '../__mocks__/utils' ;
54import { AppContext } from '../context/App' ;
65import { SettingsRoute } from './Settings' ;
76
@@ -14,32 +13,13 @@ jest.mock('react-router-dom', () => ({
1413} ) ) ;
1514
1615describe ( 'routes/Settings.tsx' , ( ) => {
17- let originalPlatform : NodeJS . Platform ;
1816 const fetchNotifications = jest . fn ( ) ;
1917 const resetSettings = jest . fn ( ) ;
2018
21- beforeAll ( ( ) => {
22- // Save the original platform value
23- originalPlatform = process . platform ;
24- mockPlatform ( 'darwin' ) ;
25- } ) ;
26-
2719 afterEach ( ( ) => {
2820 jest . clearAllMocks ( ) ;
2921 } ) ;
3022
31- afterAll ( ( ) => {
32- // Restore the original platform value
33- Object . defineProperty ( process , 'platform' , {
34- value : originalPlatform ,
35- } ) ;
36-
37- // Restore the original node env value
38- Object . defineProperty ( process , 'platform' , {
39- value : originalPlatform ,
40- } ) ;
41- } ) ;
42-
4323 it ( 'should render itself & its children' , async ( ) => {
4424 await act ( async ( ) => {
4525 render (
0 commit comments