Skip to content

Commit

Permalink
chore: remove unit test noise
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasklim committed Feb 10, 2025
1 parent 6ef1768 commit f208780
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ describe('Interceptor', () => {

beforeAll(() => {
createInterceptor(interceptorOptions);
jest.spyOn(console, 'error').mockImplementation(() => {});
});

it('Blocks websocket connections', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Preloader } from '../Preloader';

// render only Translation.id in data-test attribute
jest.mock('src/components/suite/Translation', () => ({
Translation: ({ id }: any) => <div data-testid={id}>{id}</div>,
Translation: ({ id }: any) => <span data-testid={id}>{id}</span>,
}));

// @trezor/connect fetching ethereum definitions
Expand Down Expand Up @@ -149,6 +149,24 @@ const deviceCompromisedFixtures = [
];

describe('Preloader component', () => {
beforeAll(() => {
const originalWarn = console.warn;

jest.spyOn(console, 'warn').mockImplementation((...args) => {
const warningMessage = args[0];

if (
(typeof warningMessage === 'string' &&
warningMessage.startsWith('Firmware hash check failed!')) ||
warningMessage.startsWith('Firmware revision check failed')
) {
return;
}

originalWarn(...args);
});
});

it('Loading: suite is loading', () => {
const store = initStore(
getInitialState({
Expand Down
14 changes: 14 additions & 0 deletions packages/suite/src/utils/suite/__tests__/ethereumStaking.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,20 @@ describe('getStakeFormsDefaultValues', () => {
});

describe('getStakeTxGasLimit', () => {
beforeAll(() => {
const originalError = console.error;

jest.spyOn(console, 'error').mockImplementation((...args) => {
const errorMessage = args[0];

if (typeof errorMessage === 'object') {
return;
}

originalError(...args);
});
});

getStakeTxGasLimitFixture.forEach(test => {
it(test.description, async () => {
mockTrezorConnect(test);
Expand Down

0 comments on commit f208780

Please sign in to comment.