-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
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,18 @@ | ||
it('should reject new network request', () => { | ||
cy.createAnvilNode({ | ||
chainId: 1338, | ||
port: 8546 | ||
}).then(() => { | ||
cy.get('#addEthereumChain').click() | ||
|
||
cy.rejectNewNetwork().then(() => { | ||
cy.get('#chainId').should('have.text', '0x1') | ||
|
||
cy.emptyAnvilNode() | ||
}) | ||
}) | ||
}) | ||
|
||
after(() => { | ||
cy.switchNetwork('Ethereum Mainnet') | ||
}) |
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,10 @@ | ||
it('should reject approve request', () => { | ||
cy.get('#tokenAddresses').should('be.empty') | ||
cy.get('#createToken').click() | ||
|
||
cy.confirmTransaction().then(() => { | ||
cy.get('#approveTokens').click() | ||
|
||
cy.rejectTokenPermission() | ||
}) | ||
}) |
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,44 @@ | ||
it('should reject `personal_sign`', () => { | ||
cy.get('#personalSign').click() | ||
|
||
cy.rejectSignature() | ||
|
||
cy.get('#personalSign').should( | ||
'have.text', | ||
'Error: MetaMask Personal Message Signature: User denied message signature.' | ||
) | ||
cy.get('#personalSignResult').should('have.text', '') | ||
}) | ||
|
||
it('should reject `eth_signTypedData`', () => { | ||
cy.get('#signTypedData').click() | ||
|
||
cy.rejectSignature() | ||
|
||
cy.get('#signTypedDataResult').should( | ||
'have.text', | ||
'Error: MetaMask Typed Message Signature: User denied message signature.' | ||
) | ||
}) | ||
|
||
it('should reject `eth_signTypedData_v3`', () => { | ||
cy.get('#signTypedDataV3').click() | ||
|
||
cy.rejectSignature() | ||
|
||
cy.get('#signTypedDataV3Result').should( | ||
'have.text', | ||
'Error: MetaMask Typed Message Signature: User denied message signature.' | ||
) | ||
}) | ||
|
||
it('should reject `eth_signTypedData_v4`', () => { | ||
cy.get('#signTypedDataV4').click() | ||
|
||
cy.rejectSignature() | ||
|
||
cy.get('#signTypedDataV4Result').should( | ||
'have.text', | ||
'Error: MetaMask Typed Message Signature: User denied message signature.' | ||
) | ||
}) |
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,11 @@ | ||
it('should reject switch network request', () => { | ||
cy.switchNetwork('Ethereum Mainnet').then(() => { | ||
cy.get('#chainId').should('have.text', '0x1') | ||
|
||
cy.get('#switchEthereumChain').click() | ||
|
||
cy.rejectSwitchNetwork() | ||
|
||
cy.get('#chainId').should('have.text', '0x1') | ||
}) | ||
}) |
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,8 @@ | ||
it('should reject contract deployment', () => { | ||
cy.get('#tokenAddresses').should('be.empty') | ||
cy.get('#createToken').click() | ||
|
||
cy.rejectTransaction().then(() => { | ||
cy.get('#tokenAddresses').should('have.text', 'Creation Failed') | ||
}) | ||
}) |