483e034e63
- Changed root route (/) to show OnlineBoardStartPage directly instead of redirecting - Updated component tests to visit /components route - Fixed button component test assertions (CSS checks and disabled state verification)
30 lines
854 B
TypeScript
30 lines
854 B
TypeScript
describe('Button Component', () => {
|
|
beforeEach(() => {
|
|
cy.visit('/components')
|
|
})
|
|
|
|
it('should render button with text', () => {
|
|
cy.get('[data-testid="button"]').should('exist')
|
|
})
|
|
|
|
it('should have correct styling', () => {
|
|
cy.get('[data-testid="button"]').should(($btn) => {
|
|
expect($btn).to.have.css('padding')
|
|
expect($btn).to.have.css('border-radius')
|
|
})
|
|
})
|
|
|
|
it('should support variant classes', () => {
|
|
cy.get('[data-testid="button"]').should('have.class', 'button')
|
|
})
|
|
|
|
it('should support size classes', () => {
|
|
cy.get('[data-testid="button"]').should('have.class', 'button--medium')
|
|
})
|
|
|
|
it('should handle disabled state', () => {
|
|
cy.get('[data-testid="button"]').first().should('not.be.disabled')
|
|
cy.get('[data-testid="button-showcase"] button').last().should('be.disabled')
|
|
})
|
|
})
|