mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-25 11:28:51 +01:00
fix: fix non-critical warning in tests (#17567)
This commit is contained in:
parent
794f3039f1
commit
f3c00c65d0
@ -25,6 +25,7 @@
|
|||||||
"ipfsGateway": "",
|
"ipfsGateway": "",
|
||||||
"dismissSeedBackUpReminder": false,
|
"dismissSeedBackUpReminder": false,
|
||||||
"usePhishDetect": true,
|
"usePhishDetect": true,
|
||||||
|
"useMultiAccountBalanceChecker": false,
|
||||||
"participateInMetaMetrics": false,
|
"participateInMetaMetrics": false,
|
||||||
"gasEstimateType": "fee-market",
|
"gasEstimateType": "fee-market",
|
||||||
"showBetaHeader": false,
|
"showBetaHeader": false,
|
||||||
|
@ -38,6 +38,10 @@ const render = () => {
|
|||||||
},
|
},
|
||||||
allAreSelected: () => true,
|
allAreSelected: () => true,
|
||||||
nativeCurrency: 'USD',
|
nativeCurrency: 'USD',
|
||||||
|
selectNewAccountViaModal: jest.fn(),
|
||||||
|
deselectAll: jest.fn(),
|
||||||
|
selectAll: jest.fn(),
|
||||||
|
handleAccountClick: jest.fn(),
|
||||||
};
|
};
|
||||||
return renderWithProvider(<AccountList {...args} />, store);
|
return renderWithProvider(<AccountList {...args} />, store);
|
||||||
};
|
};
|
||||||
|
@ -130,13 +130,13 @@ export default function Notifications() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
NotificationItem.propTypes = {
|
NotificationItem.propTypes = {
|
||||||
notification: {
|
notification: PropTypes.exact({
|
||||||
id: PropTypes.string.isRequired,
|
id: PropTypes.string.isRequired,
|
||||||
message: PropTypes.string.isRequired,
|
message: PropTypes.string.isRequired,
|
||||||
origin: PropTypes.string.isRequired,
|
origin: PropTypes.string.isRequired,
|
||||||
createdDate: PropTypes.number.isRequired,
|
createdDate: PropTypes.number.isRequired,
|
||||||
readDate: PropTypes.number.isRequired,
|
readDate: PropTypes.number,
|
||||||
},
|
}),
|
||||||
snaps: PropTypes.array.isRequired,
|
snaps: PropTypes.array.isRequired,
|
||||||
onItemClick: PropTypes.func.isRequired,
|
onItemClick: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
@ -42,6 +42,8 @@ describe('Onboarding Flow', () => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
process.env.METAMASK_BUILD_TYPE = 'main';
|
||||||
|
|
||||||
const store = configureMockStore()(mockState);
|
const store = configureMockStore()(mockState);
|
||||||
|
|
||||||
it('should route to the default route when completedOnboarding and seedPhraseBackedUp is true', () => {
|
it('should route to the default route when completedOnboarding and seedPhraseBackedUp is true', () => {
|
||||||
|
@ -108,7 +108,7 @@ RecoveryPhraseChips.propTypes = {
|
|||||||
phraseRevealed: PropTypes.bool,
|
phraseRevealed: PropTypes.bool,
|
||||||
confirmPhase: PropTypes.bool,
|
confirmPhase: PropTypes.bool,
|
||||||
setInputValue: PropTypes.func,
|
setInputValue: PropTypes.func,
|
||||||
inputValue: PropTypes.string,
|
inputValue: PropTypes.object,
|
||||||
indicesToCheck: PropTypes.array,
|
indicesToCheck: PropTypes.array,
|
||||||
hiddenPhrase: PropTypes.bool,
|
hiddenPhrase: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
@ -29,6 +29,7 @@ jest.mock('../../../store/actions.js', () => ({
|
|||||||
|
|
||||||
describe('SendFooter Component', () => {
|
describe('SendFooter Component', () => {
|
||||||
const props = {
|
const props = {
|
||||||
|
disabled: false,
|
||||||
history: {
|
history: {
|
||||||
push: jest.fn(),
|
push: jest.fn(),
|
||||||
},
|
},
|
||||||
@ -119,10 +120,15 @@ describe('SendFooter Component', () => {
|
|||||||
describe('Component Update', () => {
|
describe('Component Update', () => {
|
||||||
it('should match snapshot when component updated with errors', () => {
|
it('should match snapshot when component updated with errors', () => {
|
||||||
const { container, rerender } = renderWithProvider(
|
const { container, rerender } = renderWithProvider(
|
||||||
<SendFooter.WrappedComponent />,
|
<SendFooter.WrappedComponent
|
||||||
|
disabled={false}
|
||||||
|
mostRecentOverviewPage="text"
|
||||||
|
/>,
|
||||||
);
|
);
|
||||||
|
|
||||||
const sendErrorProps = {
|
const sendErrorProps = {
|
||||||
|
disabled: false,
|
||||||
|
mostRecentOverviewPage: 'text',
|
||||||
sendErrors: {
|
sendErrors: {
|
||||||
gasFee: 'gas fee error',
|
gasFee: 'gas fee error',
|
||||||
amount: 'amount error',
|
amount: 'amount error',
|
||||||
|
@ -39,6 +39,8 @@ setBackgroundConnection({
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('AwaitingSwap', () => {
|
describe('AwaitingSwap', () => {
|
||||||
|
process.env.METAMASK_BUILD_TYPE = 'main';
|
||||||
|
|
||||||
it('renders the component with initial props', () => {
|
it('renders the component with initial props', () => {
|
||||||
const store = configureMockStore()(createSwapsMockStore());
|
const store = configureMockStore()(createSwapsMockStore());
|
||||||
const { getByText, getByTestId } = renderWithProvider(
|
const { getByText, getByTestId } = renderWithProvider(
|
||||||
|
@ -40,13 +40,15 @@ jest.mock('../../../ducks/swaps/swaps', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('CreateNewSwap', () => {
|
describe('CreateNewSwap', () => {
|
||||||
|
const props = createProps({ sensitiveTrackingProperties: {} });
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest.clearAllMocks();
|
jest.clearAllMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renders the component with initial props', () => {
|
it('renders the component with initial props', () => {
|
||||||
const store = configureMockStore()(createSwapsMockStore());
|
const store = configureMockStore()(createSwapsMockStore());
|
||||||
const props = createProps();
|
|
||||||
const { getByText } = renderWithProvider(
|
const { getByText } = renderWithProvider(
|
||||||
<CreateNewSwap {...props} />,
|
<CreateNewSwap {...props} />,
|
||||||
store,
|
store,
|
||||||
@ -68,7 +70,7 @@ describe('CreateNewSwap', () => {
|
|||||||
});
|
});
|
||||||
navigateBackToBuildQuote.mockImplementation(navigateBackToBuildQuoteMock);
|
navigateBackToBuildQuote.mockImplementation(navigateBackToBuildQuoteMock);
|
||||||
const store = configureMockStore(middleware)(createSwapsMockStore());
|
const store = configureMockStore(middleware)(createSwapsMockStore());
|
||||||
const props = createProps();
|
|
||||||
const { getByText } = renderWithProvider(
|
const { getByText } = renderWithProvider(
|
||||||
<CreateNewSwap {...props} />,
|
<CreateNewSwap {...props} />,
|
||||||
store,
|
store,
|
||||||
|
@ -28,6 +28,7 @@ const createProps = (customProps = {}) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
describe('LoadingSwapsQuotes', () => {
|
describe('LoadingSwapsQuotes', () => {
|
||||||
|
process.env.METAMASK_BUILD_TYPE = 'main';
|
||||||
it('renders the component with initial props', () => {
|
it('renders the component with initial props', () => {
|
||||||
const store = configureMockStore()(createSwapsMockStore());
|
const store = configureMockStore()(createSwapsMockStore());
|
||||||
const { getByText } = renderWithProvider(
|
const { getByText } = renderWithProvider(
|
||||||
|
@ -5,6 +5,7 @@ import ViewOnBlockExplorer from '.';
|
|||||||
|
|
||||||
const createProps = (customProps = {}) => {
|
const createProps = (customProps = {}) => {
|
||||||
return {
|
return {
|
||||||
|
sensitiveTrackingProperties: {},
|
||||||
txHash:
|
txHash:
|
||||||
'0x58e5a0fc7fbc849eddc100d44e86276168a8c7baaa5604e44ba6f5eb8ba1b7eb',
|
'0x58e5a0fc7fbc849eddc100d44e86276168a8c7baaa5604e44ba6f5eb8ba1b7eb',
|
||||||
blockExplorerUrl: 'https://etherscan.io',
|
blockExplorerUrl: 'https://etherscan.io',
|
||||||
|
@ -24,6 +24,8 @@ jest.mock('@metamask/logo', () => () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('Unlock Page', () => {
|
describe('Unlock Page', () => {
|
||||||
|
process.env.METAMASK_BUILD_TYPE = 'main';
|
||||||
|
|
||||||
const mockState = {
|
const mockState = {
|
||||||
metamask: {},
|
metamask: {},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user