diff --git a/CHANGELOG.md b/CHANGELOG.md index e64ca1f1b..37728f11b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -96,6 +96,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [10.21.2] ### Fixed - Fix undefined txParams when calling approveTransaction, by adding the id on the txMeta argument ([#16382](https://github.com/MetaMask/metamask-extension/pull/16382)) +### 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 diff --git a/test/e2e/tests/dapp-interactions.spec.js b/test/e2e/tests/dapp-interactions.spec.js index de62b9449..652f28c1e 100644 --- a/test/e2e/tests/dapp-interactions.spec.js +++ b/test/e2e/tests/dapp-interactions.spec.js @@ -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'); diff --git a/ui/components/app/signature-request-original/__snapshots__/signature-request-original.test.js.snap b/ui/components/app/signature-request-original/__snapshots__/signature-request-original.test.js.snap index 9b00c9dc9..d1ed1310f 100644 --- a/ui/components/app/signature-request-original/__snapshots__/signature-request-original.test.js.snap +++ b/ui/components/app/signature-request-original/__snapshots__/signature-request-original.test.js.snap @@ -135,9 +135,11 @@ exports[`SignatureRequestOriginal should match snapshot 1`] = `
- + https://happydapp.website/governance?futarchy=true - +
) : ( - {siteOrigin} + {siteOrigin} )}
); diff --git a/ui/components/ui/site-origin/site-origin.test.js b/ui/components/ui/site-origin/site-origin.test.js new file mode 100644 index 000000000..d27f1ce73 --- /dev/null +++ b/ui/components/ui/site-origin/site-origin.test.js @@ -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( + , + ); + const bdiElement = wrapper.find('bdi'); + + expect(bdiElement.text()).toBe('0-example.com'); + }); +});