Skip to content

Commit 9f9f836

Browse files
committed
Test adjustments
1 parent a6d172b commit 9f9f836

2 files changed

Lines changed: 16 additions & 5 deletions

File tree

tests/cypress/integration/features/interface.cy.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,26 @@ describe('Feature Grouping and Persistence', { tags: '@slow' }, () => {
5656

5757
cy.visit('/wp-admin/admin.php?page=elasticpress');
5858
});
59+
});
5960

61+
// eslint-disable-next-line jest/valid-describe-callback
62+
describe('multiple features', { tags: '@slow' }, () => {
63+
before(() => {
64+
cy.activatePlugin('multiple-required-features', 'wpCli');
65+
});
66+
after(() => {
67+
cy.deactivatePlugin('multiple-required-features', 'wpCli');
68+
});
6069
it('supports multiple required features', () => {
70+
cy.maybeDisableFeature('facets');
71+
cy.maybeDisableFeature('documents');
6172
cy.login();
6273
cy.visit('/wp-admin/admin.php?page=elasticpress');
63-
cy.contains('button', 'Live Search').click();
64-
cy.contains('button', 'Autosuggest').click();
74+
cy.contains('button', 'Core Search').click();
75+
cy.contains('button', 'Related Posts').click();
6576
cy.contains(
6677
'.components-notice.is-error',
67-
'The Related Posts, and Documents features must be enabled to use this feature.',
78+
'The Filters, and Documents features must be enabled to use this feature.',
6879
);
6980
});
7081
});

tests/cypress/wordpress-files/test-plugins/multiple-required-features.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
*/
1010

1111
$modify_feature = function ( $feature ) {
12-
if ( 'autosuggest' !== $feature->slug ) {
12+
if ( 'related_posts' !== $feature->slug ) {
1313
return $feature;
1414
}
15-
$feature->requires_feature = [ 'related_posts', 'documents' ];
15+
$feature->requires_feature = [ 'facets', 'documents' ];
1616
return $feature;
1717
};
1818
add_filter( 'ep_feature_create', $modify_feature, 10, 3 );

0 commit comments

Comments
 (0)