Skip to content

Commit

Permalink
test: Fix invalid fixture builder (#29783)
Browse files Browse the repository at this point in the history
## **Description**

Two of the permission fixture builders were adding permissions for
accounts that do not exist. They have been updated to only grant
permissions for the selected account, which is the only account
guaranteed to exist in the default fixture.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29783?quickstart=1)

## **Related issues**

This was extracted from
#27847

## **Manual testing steps**

See that E2E tests still pass

## **Screenshots/Recordings**

N/A

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
  • Loading branch information
Gudahtt authored Jan 17, 2025
1 parent 3b85633 commit 582ec93
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions test/e2e/fixture-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,7 @@ class FixtureBuilder {
caveats: [
{
type: 'restrictReturnedAccounts',
value: [
selectedAccount.toLowerCase(),
'0x09781764c08de8ca82e156bbf156a3ca217c7950',
],
value: [selectedAccount.toLowerCase()],
},
],
date: 1664388714636,
Expand Down Expand Up @@ -594,10 +591,7 @@ class FixtureBuilder {
caveats: [
{
type: 'restrictReturnedAccounts',
value: [
'0x5cfe73b6021e818b776b421b1c4db2474086a7e1',
'0x09781764c08de8ca82e156bbf156a3ca217c7950',
],
value: ['0x5cfe73b6021e818b776b421b1c4db2474086a7e1'],
},
],
date: 1664388714636,
Expand All @@ -614,10 +608,7 @@ class FixtureBuilder {
caveats: [
{
type: 'restrictReturnedAccounts',
value: [
'0x5cfe73b6021e818b776b421b1c4db2474086a7e1',
'0x09781764c08de8ca82e156bbf156a3ca217c7950',
],
value: ['0x5cfe73b6021e818b776b421b1c4db2474086a7e1'],
},
],
date: 1664388714636,
Expand Down

0 comments on commit 582ec93

Please sign in to comment.