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)
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
import { Navigate, RouteObject } from 'react-router-dom'
|
||||
|
||||
const routes: RouteObject[] = [
|
||||
// Root redirect to onlineboard
|
||||
// Root shows OnlineBoardStartPage
|
||||
{
|
||||
path: '/',
|
||||
element: <Navigate to="/onlineboard" replace />,
|
||||
lazy: async () => {
|
||||
const { OnlineBoardStartPage } = await import(
|
||||
'../pages/OnlineBoardStartPage'
|
||||
)
|
||||
return { Component: OnlineBoardStartPage }
|
||||
},
|
||||
},
|
||||
// Online Board routes
|
||||
// Online Board routes (alias for backward compatibility)
|
||||
{
|
||||
path: '/onlineboard',
|
||||
lazy: async () => {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { defineConfig } from 'cypress'
|
||||
|
||||
export default defineConfig({
|
||||
e2e: {
|
||||
baseUrl: 'http://localhost:3001',
|
||||
baseUrl: 'http://127.0.0.1:3001',
|
||||
supportFile: 'cypress/support/index.ts',
|
||||
specPattern: ['cypress/integration/**/*.cy.ts', 'cypress/integration/**/*.spec.ts'],
|
||||
viewportWidth: 1440,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
describe('Button Component', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/')
|
||||
cy.visit('/components')
|
||||
})
|
||||
|
||||
it('should render button with text', () => {
|
||||
@@ -8,9 +8,10 @@ describe('Button Component', () => {
|
||||
})
|
||||
|
||||
it('should have correct styling', () => {
|
||||
cy.get('[data-testid="button"]')
|
||||
.should('have.css', 'padding')
|
||||
.should('have.css', 'border-radius')
|
||||
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', () => {
|
||||
@@ -22,6 +23,7 @@ describe('Button Component', () => {
|
||||
})
|
||||
|
||||
it('should handle disabled state', () => {
|
||||
cy.get('[data-testid="button"]').should('not.be.disabled')
|
||||
cy.get('[data-testid="button"]').first().should('not.be.disabled')
|
||||
cy.get('[data-testid="button-showcase"] button').last().should('be.disabled')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -3,7 +3,7 @@ import { dataHelpers } from '../../support/helpers/data-helpers'
|
||||
|
||||
describe('DatePicker Component Tests', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/')
|
||||
cy.visit('/components')
|
||||
})
|
||||
|
||||
describe('DatePicker Display', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { uiHelpers } from '../../support/helpers/ui-helpers'
|
||||
|
||||
describe('Input Component Tests', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/')
|
||||
cy.visit('/components')
|
||||
})
|
||||
|
||||
describe('Input Display', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { uiHelpers } from '../../support/helpers/ui-helpers'
|
||||
|
||||
describe('Modal Component Tests', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/')
|
||||
cy.visit('/components')
|
||||
})
|
||||
|
||||
describe('Modal Display', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { uiHelpers } from '../../support/helpers/ui-helpers'
|
||||
|
||||
describe('Tabs Component Tests', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/')
|
||||
cy.visit('/components')
|
||||
})
|
||||
|
||||
describe('Tabs Display', () => {
|
||||
|
||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 214 KiB |
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 216 KiB |
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 232 KiB |
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 149 KiB |
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 243 KiB |
Reference in New Issue
Block a user