diff --git a/cypress/component/card.cy.tsx b/cypress/component/card.cy.tsx new file mode 100644 index 00000000..64abff1f --- /dev/null +++ b/cypress/component/card.cy.tsx @@ -0,0 +1,76 @@ +import { + BdsAvatar, + BdsButtonIcon, + BdsCard, + BdsCardBody, + BdsCardFooter, + BdsCardHeader, + BdsCardSubtitle, + BdsCardTitle, + BdsGrid, + BdsIcon, + BdsTypo, +} from '../dist/blip-ds-react'; + +const Card = () => { + return ( + <> + + + + + + + + + + + + + + + + + Blip Chat + + + + ); +}; + +describe('Teste de Renderização Card', () => { + // Teste de Renderização + it('deve renderizar o button com o clickable correto', () => { + cy.mount(); + cy.get('bds-card').should('have.attr', 'clickable', 'true'); + }); + it('deve renderizar o button com o height correto', () => { + cy.mount(); + cy.get('bds-card').should('have.attr', 'height', '200px'); + }); + it('deve renderizar o button com o width correto', () => { + cy.mount(); + cy.get('bds-card').should('have.attr', 'width', 'fit-content'); + }); +}); + +describe('Teste de Eventos Card', () => { + // Teste de Evento bdsClick + it('deve chamar o evento onBdsClick ao clicar', () => { + cy.mount(); + cy.get('bds-card').click(); + cy.get('@bdsClick').should('have.been.called'); + }); +}); + +describe('Teste de Acessibilidade button', () => { + // Teste de Acessibilidade com Tab + it('deve ser possível navegar para o button usando a tecla Tab', () => { + cy.mount(); + cy.get('button').first().focus(); + cy.wait(50); + cy.realPress('Tab'); + cy.wait(50); + cy.get('bds-card').should('have.focus'); + }); +});