fix test files

This commit is contained in:
Rohid
2024-08-31 17:51:40 +06:00
parent d7cd69783b
commit fd94e53ac1
6 changed files with 87 additions and 77 deletions

View File

@@ -1,15 +1,16 @@
import React from 'react';
import { Browser } from 'webextension-polyfill';
import { renderWithProviders } from '../utils/test-utils';
import MainList from './MainList';
jest.mock<typeof import('webextension-polyfill')>('webextension-polyfill', () => {
return {
runtime: {
getManifest: () => {
return { version: 'test-version' };
},
getManifest: () => ({
version: 'test-version',
}),
},
};
} as Browser;
});
describe('MainList', () => {

View File

@@ -1,4 +1,5 @@
import React from 'react';
import { Browser } from 'webextension-polyfill';
import { renderWithProviders } from '../utils/test-utils';
import NavBar from './NavBar';
@@ -9,7 +10,7 @@ jest.mock<typeof import('webextension-polyfill')>('webextension-polyfill', () =>
return { version: 'test-version' };
},
},
};
} as Browser;
});
describe('NavBar', () => {

View File

@@ -1,3 +1,4 @@
import { Browser } from 'webextension-polyfill';
import config from './config';
jest.mock<typeof import('webextension-polyfill')>('webextension-polyfill', () => {
@@ -7,7 +8,7 @@ jest.mock<typeof import('webextension-polyfill')>('webextension-polyfill', () =>
return { version: 'test-version' };
},
},
};
} as Browser;
});
describe('wakatime config', () => {
@@ -68,6 +69,7 @@ describe('wakatime config', () => {
"tiktok.com",
"twitter.com",
"whatsapp.com",
"x.com",
"youtube.com",
],
"states": [