Skip to content

Commit 590dee2

Browse files
committed
add 2 tests for the card test file
1 parent 5c05a5f commit 590dee2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

cypress/components/Card.cy.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,23 @@ describe('Card Component', () => {
7070
cy.get('[data-test="card-icon"]').should('not.exist');
7171
cy.get('[data-test="card-link"]').should('not.exist');
7272
});
73+
74+
// Test hover interactions for cards with links
75+
it('should show "Read More" text when link is provided', () => {
76+
cy.mount(<Card {...RoadmapProps} />);
77+
cy.get('[data-test="card-read-more"]').should('exist');
78+
cy.get('[data-test="card-read-more"]').should('have.text', 'Read More');
79+
});
80+
81+
// Test different text size combinations
82+
it('should render card with small header and large body text sizes', () => {
83+
const smallHeaderLargeBody = {
84+
...RoadmapProps,
85+
headerSize: 'small',
86+
bodyTextSize: 'large',
87+
};
88+
cy.mount(<Card {...smallHeaderLargeBody} />);
89+
cy.get('[data-test="card-title"]').should('have.class', 'text-[0.9rem]');
90+
cy.get('[data-test="card-body"]').should('have.class', 'text-[1.5rem]');
91+
});
7392
});

0 commit comments

Comments
 (0)