9356945d93
- 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
28 lines
738 B
TypeScript
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')
|
|
})
|
|
})
|