mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +01:00
Fix the rendering of certain domain names in connected-sites list (#16074)
* Fix rendering origins in connected-sites list
This commit is contained in:
parent
121b6809f8
commit
300919cfcc
@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
### Fixed
|
||||
- Fix issue where domain names were not always beign rendered correctly in the connected sites list ([#16074](https://github.com/MetaMask/metamask-extension/pull/16074))
|
||||
|
||||
## [10.21.1]
|
||||
### Changed
|
||||
|
@ -112,11 +112,11 @@ describe('Dapp interactions', function () {
|
||||
await driver.clickElement({ text: 'Connected sites', tag: 'span' });
|
||||
const connectedDapp1 = await driver.isElementPresent({
|
||||
text: 'http://127.0.0.1:8080',
|
||||
tag: 'span',
|
||||
tag: 'bdi',
|
||||
});
|
||||
const connectedDapp2 = await driver.isElementPresent({
|
||||
text: 'http://127.0.0.1:8081',
|
||||
tag: 'span',
|
||||
tag: 'bdi',
|
||||
});
|
||||
|
||||
assert.ok(connectedDapp1, 'Account not connected to Dapp1');
|
||||
|
@ -135,9 +135,11 @@ exports[`SignatureRequestOriginal should match snapshot 1`] = `
|
||||
<div
|
||||
class="site-origin request-signature__origin"
|
||||
>
|
||||
<span>
|
||||
<bdi
|
||||
dir="ltr"
|
||||
>
|
||||
https://happydapp.website/governance?futarchy=true
|
||||
</span>
|
||||
</bdi>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
|
@ -30,7 +30,7 @@ export default function SiteOrigin({
|
||||
rightIcon={rightIcon}
|
||||
/>
|
||||
) : (
|
||||
<span>{siteOrigin}</span>
|
||||
<bdi dir="ltr">{siteOrigin}</bdi>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
24
ui/components/ui/site-origin/site-origin.test.js
Normal file
24
ui/components/ui/site-origin/site-origin.test.js
Normal file
@ -0,0 +1,24 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import SiteOrigin from './site-origin';
|
||||
|
||||
describe('SiteOrigin', () => {
|
||||
const defaultProps = {
|
||||
siteOrigin: 'https://example.com',
|
||||
iconSrc: 'https://example.com/icon.png',
|
||||
iconName: 'icon',
|
||||
chip: false,
|
||||
className: '',
|
||||
rightIcon: false,
|
||||
};
|
||||
|
||||
it('renders number and hyphen prefixed domains correctly', () => {
|
||||
const numberHyphenPrefixOrigin = '0-example.com';
|
||||
const wrapper = shallow(
|
||||
<SiteOrigin {...defaultProps} siteOrigin={numberHyphenPrefixOrigin} />,
|
||||
);
|
||||
const bdiElement = wrapper.find('bdi');
|
||||
|
||||
expect(bdiElement.text()).toBe('0-example.com');
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user