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