website refactor
This commit is contained in:
@@ -139,4 +139,42 @@ describe('Architecture Guardrails', () => {
|
||||
|
||||
expect(violations.length).toBe(0);
|
||||
});
|
||||
|
||||
// NEW: Contract enforcement tests
|
||||
it('should enforce: PageQuery classes must implement PageQuery contract', () => {
|
||||
const violations = guardrails.getFilteredViolations().filter(
|
||||
v => v.ruleName === 'pagequery-must-implement-contract' ||
|
||||
v.ruleName === 'pagequery-must-have-execute' ||
|
||||
v.ruleName === 'pagequery-execute-return-type'
|
||||
);
|
||||
|
||||
expect(violations.length).toBe(0);
|
||||
});
|
||||
|
||||
it('should enforce: Presenter classes must implement Presenter contract', () => {
|
||||
const violations = guardrails.getFilteredViolations().filter(
|
||||
v => v.ruleName === 'presenter-must-implement-contract' ||
|
||||
v.ruleName === 'presenter-must-have-present' ||
|
||||
v.ruleName === 'presenter-must-be-client'
|
||||
);
|
||||
|
||||
expect(violations.length).toBe(0);
|
||||
});
|
||||
|
||||
it('should enforce: ViewModel classes must extend ViewModel contract', () => {
|
||||
const violations = guardrails.getFilteredViolations().filter(
|
||||
v => v.ruleName === 'viewmodel-must-extend-contract' ||
|
||||
v.ruleName === 'viewmodel-must-be-client'
|
||||
);
|
||||
|
||||
expect(violations.length).toBe(0);
|
||||
});
|
||||
|
||||
it('should enforce: DisplayObject files must export only classes', () => {
|
||||
const violations = guardrails.getFilteredViolations().filter(
|
||||
v => v.ruleName === 'no-non-class-display-exports'
|
||||
);
|
||||
|
||||
expect(violations.length).toBe(0);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user