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:
parent
07139b1aac
commit
cbe438e704
3
app/_locales/en/messages.json
generated
3
app/_locales/en/messages.json
generated
@ -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"
|
||||
},
|
||||
|
@ -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/',
|
||||
|
@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user