|
1 | | -import { SocialShareButtons } from '@/components/social-share-buttons'; |
| 1 | +import { ShareTwitterButton, ShareLinkedInButton } from '@/components/share-buttons'; |
2 | 2 |
|
3 | | -describe('Social Share Buttons', () => { |
4 | | - beforeEach(() => { |
5 | | - cy.mount(<SocialShareButtons />); |
6 | | - }); |
7 | | - |
8 | | - it('social share buttons container is visible', () => { |
9 | | - cy.get('[data-testid="social-share-buttons"]').should('be.visible'); |
10 | | - }); |
11 | | - |
12 | | - it('Twitter share button is present and is a button element', () => { |
| 3 | +describe('Share Buttons', () => { |
| 4 | + it('Twitter share button renders and is a button element', () => { |
| 5 | + cy.mount(<ShareTwitterButton />); |
13 | 6 | cy.get('[data-testid="share-twitter"]').should('exist'); |
14 | 7 | cy.get('[data-testid="share-twitter"]').should('have.prop', 'tagName', 'BUTTON'); |
15 | 8 | }); |
16 | 9 |
|
17 | | - it('LinkedIn share button is present and is a button element', () => { |
18 | | - cy.get('[data-testid="share-linkedin"]').should('exist'); |
19 | | - cy.get('[data-testid="share-linkedin"]').should('have.prop', 'tagName', 'BUTTON'); |
20 | | - }); |
21 | | - |
22 | 10 | it('Twitter share button has a descriptive title referencing Twitter or X', () => { |
| 11 | + cy.mount(<ShareTwitterButton />); |
23 | 12 | cy.get('[data-testid="share-twitter"]') |
24 | 13 | .should('have.attr', 'title') |
25 | 14 | .and('match', /Twitter|X/i); |
26 | 15 | }); |
27 | 16 |
|
| 17 | + it('LinkedIn share button renders and is a button element', () => { |
| 18 | + cy.mount(<ShareLinkedInButton />); |
| 19 | + cy.get('[data-testid="share-linkedin"]').should('exist'); |
| 20 | + cy.get('[data-testid="share-linkedin"]').should('have.prop', 'tagName', 'BUTTON'); |
| 21 | + }); |
| 22 | + |
28 | 23 | it('LinkedIn share button has a descriptive title referencing LinkedIn', () => { |
| 24 | + cy.mount(<ShareLinkedInButton />); |
29 | 25 | cy.get('[data-testid="share-linkedin"]') |
30 | 26 | .should('have.attr', 'title') |
31 | 27 | .and('include', 'LinkedIn'); |
32 | 28 | }); |
33 | 29 | }); |
34 | | - |
35 | | -describe('Social Share Buttons (compact)', () => { |
36 | | - it('renders in compact mode', () => { |
37 | | - cy.mount(<SocialShareButtons compact />); |
38 | | - cy.get('[data-testid="social-share-buttons"]').should('be.visible'); |
39 | | - cy.get('[data-testid="share-twitter"]').should('exist'); |
40 | | - cy.get('[data-testid="share-linkedin"]').should('exist'); |
41 | | - }); |
42 | | -}); |
0 commit comments