Skip to content

Commit 117d942

Browse files
committed
reset option after
1 parent b7a4889 commit 117d942

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

tests/cypress/integration/next-steps-widget.cy.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// <reference types="Cypress" />
22
import {
33
wpLogin,
4-
setTestNextStepsData
4+
setTestNextStepsData,
5+
resetNextStepsData
56
} from '../wp-module-support/utils.cy';
67

78
describe('Next Steps Widget', { testIsolation: true }, () => {
@@ -10,6 +11,11 @@ describe('Next Steps Widget', { testIsolation: true }, () => {
1011
setTestNextStepsData();
1112
} );
1213

14+
after( () => {
15+
// Reset test data
16+
resetNextStepsData();
17+
} );
18+
1319
beforeEach(() => {
1420
wpLogin();
1521
cy.visit('/wp-admin/index.php');

tests/cypress/wp-module-support/next-steps-helpers.cy.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { wpCli } from './utils.cy';
2-
31
/**
42
* Helper functions for testing Next Steps functionality
53
*
@@ -397,12 +395,3 @@ export const toggleDismissedTasks = () => {
397395
.scrollIntoView()
398396
.click( { force: true } ); // Force click to handle potential overlapping elements
399397
};
400-
401-
/**
402-
* Reset test data for clean test state
403-
*/
404-
export const resetNextStepsData = () => {
405-
// Use cy.exec to run wp-cli commands through wp-env
406-
wpCli( 'option delete nfd_next_steps', { failOnNonZeroExit: false } );
407-
408-
};

tests/cypress/wp-module-support/utils.cy.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,11 @@ export const setTestNextStepsData = () => {
4141
) }' --format=json`
4242
);
4343
};
44+
45+
/**
46+
* Reset test data for clean test state
47+
*/
48+
export const resetNextStepsData = () => {
49+
// Use cy.exec to run wp-cli commands through wp-env
50+
wpCli( 'option delete nfd_next_steps', { failOnNonZeroExit: false } );
51+
};

0 commit comments

Comments
 (0)