diff --git a/frontend/cypress/e2e/history.spec.ts b/frontend/cypress/e2e/history.spec.ts index 89ab41351..91df3515d 100644 --- a/frontend/cypress/e2e/history.spec.ts +++ b/frontend/cypress/e2e/history.spec.ts @@ -91,16 +91,24 @@ describe('History', () => { it('Cards', () => { cy.getByCypressId('history-card').should('be.visible') - cy.getByCypressId('history-entry-pin-button').first().as('pin-button') - cy.get('@pin-button').should('have.attr', 'data-cypress-pinned', 'true').click() - cy.get('@pin-button').should('have.attr', 'data-cypress-pinned', 'false') + cy.get('[data-cypress-card-title=Features]') + .findByCypressId('history-entry-pin-button') + .should('have.attr', 'data-cypress-pinned', 'true') + .click() + cy.get('[data-cypress-card-title=Features]') + .findByCypressId('history-entry-pin-button') + .should('have.attr', 'data-cypress-pinned', 'false') }) it('Table', () => { cy.getByCypressId('history-mode-table').click() - cy.getByCypressId('history-entry-pin-button').first().as('pin-button') - cy.get('@pin-button').should('have.attr', 'data-cypress-pinned', 'true').click() - cy.get('@pin-button').should('have.attr', 'data-cypress-pinned', 'false') + cy.get('[data-cypress-entry-title=Features]') + .findByCypressId('history-entry-pin-button') + .should('have.attr', 'data-cypress-pinned', 'true') + .click() + cy.get('[data-cypress-entry-title=Features]') + .findByCypressId('history-entry-pin-button') + .should('have.attr', 'data-cypress-pinned', 'false') }) }) @@ -113,13 +121,19 @@ describe('History', () => { it('Cards', () => { cy.getByCypressId('history-card').should('be.visible') - cy.getByCypressId('history-entry-pin-button').first().click() + cy.get('[data-cypress-card-title=Features]') + .findByCypressId('history-entry-pin-button') + .should('have.attr', 'data-cypress-pinned', 'true') + .click() cy.getByCypressId('notification-toast').should('be.visible') }) it('Table', () => { cy.getByCypressId('history-mode-table').click() - cy.getByCypressId('history-entry-pin-button').first().click() + cy.get('[data-cypress-entry-title=Features]') + .findByCypressId('history-entry-pin-button') + .should('have.attr', 'data-cypress-pinned', 'true') + .click() cy.getByCypressId('notification-toast').should('be.visible') }) }) diff --git a/frontend/src/components/history-page/history-card/history-card.tsx b/frontend/src/components/history-page/history-card/history-card.tsx index 910409072..b67c9ba08 100644 --- a/frontend/src/components/history-page/history-card/history-card.tsx +++ b/frontend/src/components/history-page/history-card/history-card.tsx @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: AGPL-3.0-only */ -import { cypressId } from '../../../utils/cypress-attribute' +import { cypressAttribute, cypressId } from '../../../utils/cypress-attribute' import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon' import { EntryMenu } from '../entry-menu/entry-menu' import type { HistoryEntryProps, HistoryEventHandlers } from '../history-content/history-content' @@ -57,7 +57,10 @@ export const HistoryCard: React.FC = ( const lastVisited = useMemo(() => formatHistoryDate(entry.lastVisitedAt), [entry.lastVisitedAt]) return ( -
+
diff --git a/frontend/src/components/history-page/history-table/history-table-row.tsx b/frontend/src/components/history-page/history-table/history-table-row.tsx index b648d7970..a7f07ecc5 100644 --- a/frontend/src/components/history-page/history-table/history-table-row.tsx +++ b/frontend/src/components/history-page/history-table/history-table-row.tsx @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: AGPL-3.0-only */ -import { cypressId } from '../../../utils/cypress-attribute' +import { cypressAttribute, cypressId } from '../../../utils/cypress-attribute' import { EntryMenu } from '../entry-menu/entry-menu' import type { HistoryEntryProps, HistoryEventHandlers } from '../history-content/history-content' import { PinButton } from '../pin-button/pin-button' @@ -42,7 +42,7 @@ export const HistoryTableRow: React.FC }, [onDeleteNoteClick, entry.identifier]) return ( - + {entryTitle}