<<<<<<< HEAD
This directory contains automated tests for the MBTQ.dev's open source deaf-first platform APIs.
tests/
├── deafauth/ # DeafAUTH (Identity Cortex) tests
├── pinksync/ # PinkSync (Accessibility Engine) tests
├── fibonrose/ # Fibonrose (Trust & Blockchain) tests
├── magicians/ # 360Magicians (AI Agents) tests
├── dao/ # DAO (Governance) tests
└── openapi.test.js # OpenAPI specification validation tests
npm installnpm testnpm run test:coveragenpm run test:watch# DeafAUTH tests
npm test -- tests/deafauth
# PinkSync tests
npm test -- tests/pinksync
# 360Magicians tests
npm test -- tests/magicians
# Fibonrose tests
npm test -- tests/fibonrose
# DAO tests
npm test -- tests/dao
# OpenAPI validation tests
npm test -- tests/openapi.test.jsThe test suite covers:
- ✅ User registration
- ✅ User login
- ✅ Token verification
- ✅ Token refresh
- ✅ Error handling for invalid credentials
- ✅ Validation of email format
- ✅ Sync status checking
- ✅ Accessibility preferences updates
- ✅ Feature listing
- ✅ Authentication requirements
- ✅ Preference validation
- ✅ Transaction verification
- ✅ Trust score retrieval
- ✅ Transaction recording
- ✅ Transaction format validation
- ✅ Invalid transaction handling
- ✅ Agent creation
- ✅ Agent listing and retrieval
- ✅ Agent deletion
- ✅ Agent execution
- ✅ Run status tracking
- ✅ Tool management
- ✅ Memory operations
- ✅ Health checks
- ✅ Proposal listing
- ✅ Vote submission
- ✅ Member listing
- ✅ Vote validation
- ✅ Duplicate vote prevention
- ✅ Status filtering
- ✅ Valid OpenAPI 3.1.0 version
- ✅ Required info fields
- ✅ Server definitions
- ✅ Security schemes
- ✅ Path definitions
- ✅ Response descriptions
- ✅ Cross-service consistency
- Jest: Testing framework
- Axios: HTTP client (mocked for unit tests)
Follow the existing test patterns:
describe('Service Name API', () => {
const baseURL = 'https://api.mbtq.dev/deaf-first/service';
const authToken = 'Bearer valid_token';
beforeEach(() => {
jest.clearAllMocks();
});
describe('GET /endpoint', () => {
it('should perform expected action', async () => {
// Mock response
const mockResponse = {
data: { /* expected data */ }
};
axios.get.mockResolvedValue(mockResponse);
// Make request
const response = await axios.get(`${baseURL}/endpoint`, {
headers: { Authorization: authToken }
});
// Assertions
expect(response.data).toHaveProperty('expectedField');
});
});
});These tests are designed to run in CI/CD pipelines:
# Example GitHub Actions workflow
- name: Run tests
run: npm test
- name: Generate coverage
run: npm run test:coverage- Mock External Dependencies: All HTTP requests are mocked
- Test Error Scenarios: Include negative test cases
- Clear Assertions: Use descriptive expect statements
- Cleanup: Use
beforeEachto reset mocks - Descriptive Names: Use clear test descriptions
The tests are designed to match the OpenAPI specifications in services/*/openapi/openapi.yaml. When the specs change, update the corresponding tests.
npm run validate:openapiThis validates all OpenAPI specifications for:
- Correct OpenAPI version
- Required fields
- Valid schemas
- Proper formatting
Generate SDKs from OpenAPI specs:
# Generate TypeScript SDK
npm run generate:sdk:typescript
# Generate Python SDK
npm run generate:sdk:python
# Generate all SDKs
npm run generate:sdkThis directory contains automated tests for the MBTQ Universe deaf-first platform APIs.
tests/
├── deafauth/ # DeafAUTH (Identity Cortex) tests
├── pinksync/ # PinkSync (Accessibility Engine) tests
├── fibonrose/ # Fibonrose (Trust & Blockchain) tests
├── magicians/ # 360Magicians (AI Agents) tests
├── dao/ # DAO (Governance) tests
└── openapi.test.js # OpenAPI specification validation tests
npm installnpm testnpm run test:coveragenpm run test:watch# DeafAUTH tests
npm test -- tests/deafauth
# PinkSync tests
npm test -- tests/pinksync
# 360Magicians tests
npm test -- tests/magicians
# Fibonrose tests
npm test -- tests/fibonrose
# DAO tests
npm test -- tests/dao
# OpenAPI validation tests
npm test -- tests/openapi.test.jsThe test suite covers:
- ✅ User registration
- ✅ User login
- ✅ Token verification
- ✅ Token refresh
- ✅ Error handling for invalid credentials
- ✅ Validation of email format
- ✅ Sync status checking
- ✅ Accessibility preferences updates
- ✅ Feature listing
- ✅ Authentication requirements
- ✅ Preference validation
- ✅ Transaction verification
- ✅ Trust score retrieval
- ✅ Transaction recording
- ✅ Transaction format validation
- ✅ Invalid transaction handling
- ✅ Agent creation
- ✅ Agent listing and retrieval
- ✅ Agent deletion
- ✅ Agent execution
- ✅ Run status tracking
- ✅ Tool management
- ✅ Memory operations
- ✅ Health checks
- ✅ Proposal listing
- ✅ Vote submission
- ✅ Member listing
- ✅ Vote validation
- ✅ Duplicate vote prevention
- ✅ Status filtering
- ✅ Valid OpenAPI 3.1.0 version
- ✅ Required info fields
- ✅ Server definitions
- ✅ Security schemes
- ✅ Path definitions
- ✅ Response descriptions
- ✅ Cross-service consistency
- Jest: Testing framework
- Axios: HTTP client (mocked for unit tests)
Follow the existing test patterns:
describe('Service Name API', () => {
const baseURL = 'https://api.mbtq.dev/deaf-first/service';
const authToken = 'Bearer valid_token';
beforeEach(() => {
jest.clearAllMocks();
});
describe('GET /endpoint', () => {
it('should perform expected action', async () => {
// Mock response
const mockResponse = {
data: { /* expected data */ }
};
axios.get.mockResolvedValue(mockResponse);
// Make request
const response = await axios.get(`${baseURL}/endpoint`, {
headers: { Authorization: authToken }
});
// Assertions
expect(response.data).toHaveProperty('expectedField');
});
});
});These tests are designed to run in CI/CD pipelines:
# Example GitHub Actions workflow
- name: Run tests
run: npm test
- name: Generate coverage
run: npm run test:coverage- Mock External Dependencies: All HTTP requests are mocked
- Test Error Scenarios: Include negative test cases
- Clear Assertions: Use descriptive expect statements
- Cleanup: Use
beforeEachto reset mocks - Descriptive Names: Use clear test descriptions
The tests are designed to match the OpenAPI specifications in services/*/openapi/openapi.yaml. When the specs change, update the corresponding tests.
npm run validate:openapiThis validates all OpenAPI specifications for:
- Correct OpenAPI version
- Required fields
- Valid schemas
- Proper formatting
Generate SDKs from OpenAPI specs:
# Generate TypeScript SDK
npm run generate:sdk:typescript
# Generate Python SDK
npm run generate:sdk:python
# Generate all SDKs
npm run generate:sdkGenerated SDKs will be in the sdks/ directory.
e961430... Add Node.js API automated tests and SDK generation capabilities