Files
flights_web_raw/e2e/cypress/integration/components/button.cy.ts
T
gnezim 483e034e63 fix: update routing to show online board at /, fix component tests
- 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)
2026-04-06 00:31:58 +03:00

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')
})
})