Files
flights_web_raw/e2e/cypress/integration/components/button.cy.ts
T
gnezim 9356945d93 Task 10: Create test helper files and base test templates
- Create helpers directory structure
- Add api-helpers.ts with authentication and API mocking functions
- Add ui-helpers.ts with common UI interaction utilities
- Add data-helpers.ts with test data generators
- Create base.spec.ts as reusable test template
- Update support/index.ts to import and expose helper modules globally
2026-04-05 19:19:49 +03:00

28 lines
738 B
TypeScript

describe('Button Component', () => {
beforeEach(() => {
cy.visit('http://localhost:3001')
})
it('should render button with text', () => {
cy.get('[data-testid="button"]').should('exist')
})
it('should have correct styling', () => {
cy.get('[data-testid="button"]')
.should('have.css', 'padding')
.should('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"]').should('not.be.disabled')
})
})