docbrown/cypress/e2e/seededFlows/adminFlows/shared/adminUtilities.js
Ridhwana 272aea6127
Allow admins to delete an organization (#19699)
* feat: update the layout for organizations

* feat: update the layout for an organization

* feat: organization logos are square

* feat: change the text on the org visit button

* feat: initialize the dropdown menu

* feat: trigger the  modal

* feat: update the text in the model

* feat: tweak wording

* WIP/feat: hook up a route with an action that calls an organization delete worker.

* feat: redirect after showing the notice

* feat: update the authorization required to be super admin

* feat: add the notice to localization

* spec: integration test

* spec: fix

* spec: delete worker

* chore: update the link

* feat: add safe navigation

* feat: make sure that we show an error if the organization has credits

* fix: error message for modal unspent credits

* feat add the spec for the helper

* fix: remove rspec preface

* fix: small fixes to tests and I18n

* fix: updated the number of orgs

* feat: update the message

* feat: update the message

* chore: remove inclusion of helper

* feat: change the name of the parameter

* chore: newline
2023-07-17 12:09:24 +02:00

20 lines
584 B
JavaScript

/**
* E2E helper function for user admin tests that validates the correct flash notice message appears
*
* @param {string} [message] The expected flash message text
*/
export function verifyAndDismissFlashMessage(message) {
cy.findByTestId('flash-settings_notice')
.as('notice')
.then((element) => {
expect(element.text().trim()).equal(message);
});
cy.get('@notice').within(() => {
cy.findByRole('button', { name: 'Dismiss message' })
.should('have.focus')
.click();
});
cy.findByTestId('flash-settings_notice').should('not.exist');
}