Skip to content

Commit

Permalink
Fix e2es
Browse files Browse the repository at this point in the history
  • Loading branch information
darkwing committed Sep 20, 2023
1 parent 135ea69 commit ff04005
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions app/scripts/lib/ens-ipfs/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ export default function setupEnsIpfsResolver({

const ensSiteUrl = `https://app.ens.domains/name/${name}`;

// This is the only case where we can show the loading indicator
// https://github.com/MetaMask/metamask-extension/issues/20910#issuecomment-1723962822
// We cannot show this if useAddressBarEnsResolution is off...
if (useAddressBarEnsResolution && ipfsGateway) {
browser.tabs.update(tabId, { url: 'loading.html' });
}
Expand Down Expand Up @@ -129,6 +128,8 @@ export default function setupEnsIpfsResolver({
} catch (err) {
console.warn(err);
} finally {
// Only forward to destination URL if a URL exists and
// useAddressBarEnsResolution is properly
if (
url &&
(useAddressBarEnsResolution ||
Expand Down
7 changes: 5 additions & 2 deletions test/e2e/tests/ipfs-ens-resolution.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Settings', function () {
await driver.quit();
});

it('Does not lookup IPFS data for ENS Domain when switched off', async function () {
it('Does not ENS data for ENS Domain when switched off', async function () {
let server;

await withFixtures(
Expand All @@ -54,7 +54,10 @@ describe('Settings', function () {
await driver.clickElement({ text: 'Settings', tag: 'div' });
await driver.clickElement({ text: 'Security & privacy', tag: 'div' });

// turns off IPFS domain resolution
// turns off IPFS setting
await driver.clickElement('[data-testid="ipfsToggle"] .toggle-button');

// turns off ENS domain resolution
await driver.clickElement(
'[data-testid="ipfs-gateway-resolution-container"] .toggle-button',
);
Expand Down

0 comments on commit ff04005

Please sign in to comment.