From de47da44d2338b4d78543e0375fb944171ad8422 Mon Sep 17 00:00:00 2001 From: Burhan Nasir Date: Thu, 26 May 2022 16:04:41 +0500 Subject: [PATCH] Add more tests for activate-feature command --- tests/cypress/integration/wp-cli.spec.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/cypress/integration/wp-cli.spec.js b/tests/cypress/integration/wp-cli.spec.js index e56f002e9e..364b94d76c 100644 --- a/tests/cypress/integration/wp-cli.spec.js +++ b/tests/cypress/integration/wp-cli.spec.js @@ -160,6 +160,19 @@ describe('WP-CLI Commands', () => { cy.wpCli('wp elasticpress activate-feature search') .its('stdout') .should('contain', 'Feature activated'); + + cy.wpCli('wp elasticpress activate-feature invalid', true) + .its('stderr') + .should('contain', 'No feature with that slug is registered'); + + cy.wpCli('wp elasticpress activate-feature woocommerce', true) + .its('stderr') + .should('contain', 'Feature requirements are not met'); + + cy.wpCli('wp elasticpress activate-feature protected_content', true) + .its('stderr') + .should('contain', 'This feature requires a re-index') + .should('contain', 'Feature is usable but there are warnings'); }); it('Can list all the active features if user runs wp elasticpress list-features command', () => {