- Add GitHub Actions CI workflow with lint, type-check, test, build, and e2e jobs - Configure Jest for unit and integration tests with coverage reporting - Create unit tests for BaseAgent, PlantLineageAgent, and AgentOrchestrator - Add blockchain PlantChain unit tests - Create API integration tests for plants endpoints - Configure Cypress for E2E testing with support files and custom commands - Add E2E tests for home, plant registration, transparency, and vertical farm pages - Set up Prettier for code formatting with configuration - Configure Husky pre-commit hooks with lint-staged - Add commitlint for conventional commit message enforcement - Update package.json with new scripts and dev dependencies This implements Agent 5 (Testing & CI/CD) from the deployment plan.
49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
/**
|
|
* Transparency Dashboard E2E Tests
|
|
*/
|
|
|
|
describe('Transparency Dashboard', () => {
|
|
beforeEach(() => {
|
|
cy.visit('/transparency');
|
|
cy.waitForPageLoad();
|
|
});
|
|
|
|
it('should load the transparency page', () => {
|
|
cy.url().should('include', '/transparency');
|
|
});
|
|
|
|
it('should display dashboard content', () => {
|
|
cy.get('main').should('be.visible');
|
|
});
|
|
|
|
it('should show transparency metrics', () => {
|
|
// Check for dashboard sections
|
|
cy.get('[data-testid="dashboard"], .dashboard, main').should('be.visible');
|
|
});
|
|
|
|
describe('Data Display', () => {
|
|
it('should display charts or data visualizations', () => {
|
|
// Look for chart containers or data elements
|
|
cy.get('canvas, svg, [class*="chart"], [class*="graph"]').should(
|
|
'have.length.at.least',
|
|
0
|
|
);
|
|
});
|
|
|
|
it('should display audit information', () => {
|
|
// Check for audit-related content
|
|
cy.contains(/audit|log|record|history/i).should('exist');
|
|
});
|
|
});
|
|
|
|
describe('Accessibility', () => {
|
|
it('should have proper heading structure', () => {
|
|
cy.get('h1, h2, h3').should('have.length.at.least', 1);
|
|
});
|
|
|
|
it('should be keyboard navigable', () => {
|
|
cy.get('body').tab();
|
|
cy.focused().should('exist');
|
|
});
|
|
});
|
|
});
|