diff options
Diffstat (limited to 'cypress/support')
-rw-r--r-- | cypress/support/component.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cypress/support/component.ts b/cypress/support/component.ts index eecb55c69e7..853609bb4dd 100644 --- a/cypress/support/component.ts +++ b/cypress/support/component.ts @@ -33,6 +33,11 @@ Cypress.Commands.add('mockInitialState', (app: string, key: string, value: unkno }) Cypress.Commands.add('unmockInitialState', (app?: string, key?: string) => { + cy.window().then(($window) => { + // @ts-expect-error internal value + delete $window._nc_initial_state + }) + cy.document().then(($document) => { $document.querySelectorAll('body > input[type="hidden"]' + (app ? `[id="initial-state-${app}-${key}"]` : '')) .forEach((node) => $document.body.removeChild(node)) |