Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change sync button title attribute #2814

Merged
merged 3 commits into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions includes/partials/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
<?php if ( Elasticsearch::factory()->get_elasticsearch_version() && defined( 'EP_DASHBOARD_SYNC' ) && EP_DASHBOARD_SYNC && ! $is_sync_page ) : ?>
<a
class="dashicons start-sync dashicons-update"
title="<?php esc_attr_e( 'Start Sync', 'elasticpress' ); ?>"
aria-label="<?php esc_attr_e( 'Start Sync', 'elasticpress' ); ?>"
title="<?php esc_attr_e( 'Sync Page', 'elasticpress' ); ?>"
aria-label="<?php esc_attr_e( 'Sync Page', 'elasticpress' ); ?>"
<?php echo ( $is_sync_page ) ? '' : 'href="' . esc_url( $base_url . 'elasticpress-sync' ) . '"'; ?>
></a>
<?php endif; ?>
<a href="<?php echo esc_url( $base_url . 'elasticpress-settings' ); ?>" class="dashicons dashicons-admin-generic" title="<?php esc_attr_e( 'Settings', 'elasticpress' ); ?>" aria-label="<?php esc_attr_e( 'Settings', 'elasticpress' ); ?>"></a>
<a href="<?php echo esc_url( $base_url . 'elasticpress-settings' ); ?>" class="dashicons dashicons-admin-generic" title="<?php esc_attr_e( 'Settings Page', 'elasticpress' ); ?>" aria-label="<?php esc_attr_e( 'Settings Page', 'elasticpress' ); ?>"></a>
</div>

<div class="progress-bar"></div>
Expand Down
7 changes: 7 additions & 0 deletions tests/cypress/integration/admin/settings-page.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
describe('Settings Page', () => {
it('Can see a Sync and Settings buttons on Settings Page', () => {
cy.visitAdminPage('admin.php?page=elasticpress-settings');
cy.get('.dashicons.start-sync').should('have.attr', 'title', 'Sync Page');
cy.get('.dashicons.dashicons-admin-generic').should('have.attr', 'title', 'Settings Page');
});
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is GREAT to see tests like these coming through, @burhandodhy, congrats, and thanks! Can we please move it from a whole new test to the already existent general.spec.js? The links should be on all (or almost all) pages, so although it makes sense to pick one to check, we can save a settings-page.spec.js to something particular to that page, like checking if tabs change, etc. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@felipeelia agree with you. settings-page.spec.js should only have tests that are related to settings page. I move the test to general.spec.js