-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Settings: Show extension in full size view (#22383)
Co-authored-by: Danica Shen <zhaodanica@gmail.com>
- Loading branch information
1 parent
50c0f34
commit 0851ab2
Showing
23 changed files
with
221 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
const { strict: assert } = require('assert'); | ||
const { | ||
withFixtures, | ||
unlockWallet, | ||
openDapp, | ||
defaultGanacheOptions, | ||
WINDOW_TITLES, | ||
} = require('../helpers'); | ||
const FixtureBuilder = require('../fixture-builder'); | ||
|
||
const toggleFullSizeViewSetting = async (driver) => { | ||
await driver.clickElement('[data-testid="account-options-menu-button"]'); | ||
await driver.clickElement({ text: 'Settings', tag: 'div' }); | ||
await driver.clickElement({ text: 'Advanced', tag: 'div' }); | ||
await driver.clickElement( | ||
'[data-testid="advanced-setting-show-extension-in-full-size-view"] .toggle-button > div', | ||
); | ||
}; | ||
|
||
describe('Full-size View Setting @no-mmi', function () { | ||
it('opens the extension in popup view when opened from a dapp after enabling it in Advanced Settings', async function () { | ||
await withFixtures( | ||
{ | ||
dapp: true, | ||
fixtures: new FixtureBuilder() | ||
.withNetworkControllerOnMainnet() | ||
.withPermissionControllerConnectedToTestDapp() | ||
.build(), | ||
failOnConsoleError: false, | ||
ganacheOptions: defaultGanacheOptions, | ||
title: this.test.fullTitle(), | ||
}, | ||
async ({ driver }) => { | ||
await unlockWallet(driver); | ||
await toggleFullSizeViewSetting(driver); | ||
await openDapp(driver); | ||
await driver.clickElement('#maliciousPermit'); // Opens the extension in popup view. | ||
const windowHandles = await driver.waitUntilXWindowHandles( | ||
3, | ||
1000, | ||
10000, | ||
); | ||
const fullScreenWindowTitle = await driver.getWindowTitleByHandlerId( | ||
windowHandles[0], | ||
); | ||
const dappWindowTitle = await driver.getWindowTitleByHandlerId( | ||
windowHandles[1], | ||
); | ||
const popUpWindowTitle = await driver.getWindowTitleByHandlerId( | ||
windowHandles[2], | ||
); | ||
|
||
assert.equal( | ||
fullScreenWindowTitle, | ||
WINDOW_TITLES.ExtensionInFullScreenView, | ||
); | ||
assert.equal(dappWindowTitle, WINDOW_TITLES.TestDApp); | ||
assert.equal(popUpWindowTitle, WINDOW_TITLES.Dialog); | ||
}, | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.