Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/sap/fundamental-ngx/testing-guidelinesgit clone --depth 1 https://github.com/SAP/fundamental-ngxWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.02408 |
| Opus 5 | $0.00000 | $0.01204 |
| Sonnet 5 | $0.00000 | $0.00482 |
| Haiku 4.5 | $0.00000 | $0.00241 |
Grade A, and why
testing-guidelines scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 427 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Testing Guidelines
This document covers testing patterns and best practices for Angular 22+ development in Fundamental NGX.
Table of Contents
- Test Commands
- Test Writing Guidelines
- Testing Signal-Based Components
- Testing DI Patterns
- Testing Async Operations
- ESLint Compliance in Tests
- Common Validation Pitfalls
Test Commands
# Run all tests in a library
nx test <library>
# Run specific test file
nx run <library>:test --testfile=<filename>.spec.ts
# Examples
nx run cdk:test --testfile=line-clamp.directive.spec.ts
nx run core:test --testfile=button.component.spec.ts
nx run platform:test --testfile=table.component.spec.ts
# Watch mode (recommended during development)
nx test <library> --watch
# Run affected tests only
nx affected:test
# Lint specific library
nx run <library>:lint
Test Writing Guidelines
Focus on User Scenarios, Not Edge Cases
When writing tests, ask: "Can this actually happen in a real Angular application?"
✅ Write tests for
- User interactions (clicks, inputs, keyboard)
- Valid configuration options
- Component lifecycle (mount, update, unmount)
- Accessibility requirements
- Realistic error scenarios (unsupported enum values, optional services missing)
❌ Don't write tests for
- TypeScript-prevented scenarios (
undefinedfor required parameters) - Angular DI-prevented scenarios (missing required dependencies)
- Implementation details (internal signal updates, private methods)
- Impossible states (null values in non-nullable fields)
Example: Realistic vs Unrealistic Tests
// ✅ GOOD - Tests realistic user scenario
it('should fallback to cozy when unsupported density is provided', () => {
const observer = new ContentDensityObserver(injector, {
supportedContentDensity: [ContentDensityMode.COZY],
defaultContentDensity: ContentDensityMode.COMPACT // User might try this
});
expect(observer.value).toBe(ContentDensityMode.COZY); // Fallback works
});
// ❌ BAD - Tests impossible scenario (TypeScript prevents this)
it('should handle undefined defaultContentDensity', () => {
const observer = new ContentDensityObserver(injector, {
defaultContentDensity: undefined // TypeScript won't allow this!
});
expect(observer.value).toBe(ContentDensityMode.COZY);
});
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 427 lines · 0 tokens per session scan A ccf35236f0d3
testing-guidelines is an agent published in the GitHub repository SAP/fundamental-ngx (294 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,408 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
bug-fixing-orchestrator-agent
Orchestrates bug fixing for igniteui-angular. Discovers scope and root cause, routes work to specialist agents, verifies completeness. Handles edge cases, escalation, and multi-branch fixes.
feature-orchestrator-agent
Orchestrates feature implementation for igniteui-angular. Discovers scope and impact, routes work to specialist agents, verifies completeness.
bug-fixing-implementer-agent
Implements the minimum fix (GREEN phase) for bugs in igniteui-angular. Preserves the public API, accessibility, and localization. Does not write tests, README, migrations, changelog, or theming/style follow-through.
feature-implementer-agent
Implements features (GREEN phase) and refactors for quality in igniteui-angular. Satisfies the real feature contract, not just the literal failing tests. Does not own theming/style follow-through.
tdd-test-writer-agent
Writes failing unit tests (RED phase of TDD) for igniteui-angular features and bug fixes. Creates tests before any production code exists.
theming-styles-agent
Implements component theming and style changes for igniteui-angular, including in-repo SCSS, theme wiring, and style validation.