Skip to content

Commit

Permalink
fix: Remove unused fixtures and fix test name in smart swaps disabled…
Browse files Browse the repository at this point in the history
… spec (#25616)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

Test name was not being captured correctly and recently came to
appreciate that some of the snap account related fixtures were not
actually needed for this test.

Updated test name and removed `accountSnapFixtures`

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

## **Related issues**

Fixes:  [505](MetaMask/accounts-planning#505)

## **Manual testing steps**
Firefox: 
`yarn build:test:mv2` then `ENABLE_MV3=false yarn test:e2e:single
test/e2e/accounts/smart-swap-disabled.spec.ts --browser=firefox`
Chrome:
`yarn build:test` then `yarn test:e2e:single
test/e2e/accounts/smart-swap-disabled.spec.ts --browser=chrome`

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **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/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.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
plasmacorral authored Jul 2, 2024
1 parent 548b54a commit 95407cc
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/e2e/accounts/smart-swap-disabled.spec.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { title } from 'process';
import { Suite } from 'mocha';
import { withFixtures } from '../helpers';
import { withFixtures, defaultGanacheOptions } from '../helpers';
import { Driver } from '../webdriver/driver';
import {
accountSnapFixtures,
installSnapSimpleKeyring,
makeNewAccountAndSwitch,
} from './common';
import FixtureBuilder from '../fixture-builder';
import { installSnapSimpleKeyring, makeNewAccountAndSwitch } from './common';

describe('Smart Swaps', function (this: Suite) {
it('should be disabled for snap accounts', async function () {
describe('Snap Account - Smart Swaps', function (this: Suite) {
it('checks if smart swaps are disabled for snap accounts', async function () {
await withFixtures(
accountSnapFixtures(title),
{
fixtures: new FixtureBuilder().build(),
ganacheOptions: defaultGanacheOptions,
title: this.test?.fullTitle(),
},
async ({ driver }: { driver: Driver }) => {
await installSnapSimpleKeyring(driver, false);
await makeNewAccountAndSwitch(driver);
Expand Down

0 comments on commit 95407cc

Please sign in to comment.