1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-22 09:23:21 +01:00

Update keystone links (#18792)

* update keystone links

* update tests

* fix lint
This commit is contained in:
Monte Lai 2023-04-25 21:33:43 +08:00 committed by GitHub
parent 07139b1aac
commit cbe438e704
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 13 deletions

View File

@ -1970,6 +1970,9 @@
"message": "Want to $1 about gas?",
"description": "$1 will be replaced by the learnMore translation key"
},
"learnMoreKeystone": {
"message": "Learn More"
},
"learnMoreUpperCase": {
"message": "Learn more"
},

View File

@ -33,7 +33,7 @@ export enum HardwareAffiliateLinks {
ledger = 'https://shop.ledger.com/?r=17c4991a03fa',
gridplus = 'https://gridplus.io/?afmc=7p',
trezor = 'https://shop.trezor.io/product/trezor-one-black?offer_id=35&aff_id=11009',
keystone = 'https://shop.keyst.one/?rfsn=6088257.656b3e9&utm_source=refersion&utm_medium=affiliate&utm_campaign=6088257.656b3e9',
keystone = 'https://keyst.one/metamask?rfsn=6088257.656b3e9&utm_source=refersion&utm_medium=affiliate&utm_campaign=6088257.656b3e9',
airgap = 'https://airgap.it/',
coolwallet = 'https://www.coolwallet.io/',
dcent = 'https://dcentwallet.com/',

View File

@ -18,25 +18,32 @@ jest.mock('../../../store/actions', () => ({
}));
jest.mock('../../../selectors', () => ({
getCurrentChainId: () => jest.fn().mockResolvedValue('0x1'),
getRpcPrefsForCurrentProvider: () => jest.fn().mockResolvedValue({}),
getMetaMaskAccountsConnected: () => jest.fn().mockResolvedValue([]),
getMetaMaskAccounts: () => jest.fn().mockResolvedValue([]),
getCurrentChainId: () => '0x1',
getRpcPrefsForCurrentProvider: () => {
return {};
},
getMetaMaskAccountsConnected: () => [],
getMetaMaskAccounts: () => {
return {};
},
}));
jest.mock('../../../ducks/history/history', () => ({
getMostRecentOverviewPage: () => jest.fn().mockResolvedValue('/'),
getMostRecentOverviewPage: () => '',
}));
const mockTrackEvent = jest.fn();
const mockProps = {
forgetDevice: jest.fn(),
showAlert: jest.fn(),
hideAlert: jest.fn(),
unlockHardwareWalletAccount: jest.fn(),
setHardwareWalletDefaultHdPath: jest.fn(),
forgetDevice: () => jest.fn(),
showAlert: () => jest.fn(),
hideAlert: () => jest.fn(),
unlockHardwareWalletAccount: () => jest.fn(),
setHardwareWalletDefaultHdPath: () => jest.fn(),
history: {},
defaultHdPath: "m/44'/60'/0'/0",
mostRecentOverviewPage: '',
trackEvent: () => mockTrackEvent,
};
const mockState = {
@ -148,4 +155,24 @@ describe('ConnectHardwareForm', () => {
});
});
});
describe('QR Hardware Wallet Steps', () => {
it('should render the QR hardware wallet steps', async () => {
const { getByText, getByLabelText } = renderWithProvider(
<ConnectHardwareForm {...mockProps} />,
mockStore,
);
const qrButton = getByLabelText('QRCode');
fireEvent.click(qrButton);
await waitFor(() => {
expect(getByText('Keystone')).toBeInTheDocument();
expect(getByText('AirGap Vault')).toBeInTheDocument();
expect(getByText('CoolWallet')).toBeInTheDocument();
expect(getByText("D'Cent")).toBeInTheDocument();
});
});
});
});

View File

@ -431,12 +431,12 @@ export default class SelectHardware extends Component {
onClick={() => {
this.context.trackEvent({
category: MetaMetricsEventCategory.Navigation,
event: 'Clicked Keystone Buy Now',
event: 'Clicked Keystone Learn More',
});
openWindow(HardwareAffiliateLinks.keystone);
}}
>
{this.context.t('buyNow')}
{this.context.t('learnMoreKeystone')}
</Button>
<Button
className="hw-connect__external-btn"