Skip to content

@memberjunction/ng-testing

Angular components, widgets, and services for building testing and evaluation interfaces within MemberJunction applications. This package provides a comprehensive UI toolkit for running tests, reviewing results, providing feedback, and visualizing evaluation data.

The @memberjunction/ng-testing package delivers a full suite of Angular components purpose-built for MemberJunction’s testing framework. It includes dialog components for executing tests and collecting feedback, a collection of reusable widget components for displaying scores, statuses, costs, and evaluation data, and services that orchestrate test execution and manage evaluation preferences.

graph TD
    A[TestingModule] --> B[Dialog Components]
    A --> C[Widget Components]
    A --> D[Services]

    B --> B1[TestRunDialogComponent]
    B --> B2[TestFeedbackDialogComponent]

    C --> C1[TestStatusBadgeComponent]
    C --> C2[ScoreIndicatorComponent]
    C --> C3[CostDisplayComponent]
    C --> C4[TestResultsMatrixComponent]
    C --> C5[EvaluationBadgeComponent]
    C --> C6[EvaluationModeToggleComponent]
    C --> C7[ReviewStatusIndicatorComponent]
    C --> C8[ExecutionContextComponent]

    D --> D1[TestingDialogService]
    D --> D2[TestingExecutionService]
    D --> D3[EvaluationPreferencesService]

    style A fill:#2d6a9f,stroke:#1a4971,color:#fff
    style B fill:#7c5295,stroke:#563a6b,color:#fff
    style C fill:#2d8659,stroke:#1a5c3a,color:#fff
    style D fill:#b8762f,stroke:#8a5722,color:#fff
Terminal window
npm install @memberjunction/ng-testing
import { TestingModule } from '@memberjunction/ng-testing';
@NgModule({
imports: [
TestingModule,
// ... other imports
]
})
export class YourModule { }

Opens a dialog for executing and monitoring test runs:

<mj-test-run-dialog
[visible]="showTestRunDialog"
[testSuiteId]="selectedSuiteId"
(dialogClosed)="onTestRunClosed($event)">
</mj-test-run-dialog>

Collects user feedback on individual test results:

<mj-test-feedback-dialog
[visible]="showFeedbackDialog"
[testRunId]="selectedTestRunId"
(feedbackSubmitted)="onFeedbackSubmitted($event)">
</mj-test-feedback-dialog>

Displays a color-coded badge indicating test status (passed, failed, running, etc.):

<mj-test-status-badge [status]="testResult.Status"></mj-test-status-badge>

Visual indicator for numeric scores with color gradients:

<mj-score-indicator [score]="testResult.Score"></mj-score-indicator>

Formats and displays execution cost data:

<mj-cost-display [cost]="testResult.Cost"></mj-cost-display>

Grid display comparing test results across multiple suite runs:

<mj-test-results-matrix
[matrixData]="matrixData"
(cellClicked)="onMatrixCellClicked($event)">
</mj-test-results-matrix>
<mj-evaluation-badge [evaluationType]="'automated'"></mj-evaluation-badge>
<mj-evaluation-mode-toggle
[mode]="currentMode"
(modeChanged)="onModeChanged($event)">
</mj-evaluation-mode-toggle>

Review Status Indicator and Execution Context

Section titled “Review Status Indicator and Execution Context”
<mj-review-status-indicator [status]="reviewStatus"></mj-review-status-indicator>
<mj-execution-context [context]="executionContext"></mj-execution-context>

Programmatically open testing dialogs:

import { TestingDialogService } from '@memberjunction/ng-testing';
constructor(private testingDialog: TestingDialogService) {}
openTestRun() {
this.testingDialog.openTestRunDialog(testSuiteId);
}

Manages test execution lifecycle:

import { TestingExecutionService } from '@memberjunction/ng-testing';
constructor(private testExecution: TestingExecutionService) {}
async runTests() {
const result = await this.testExecution.executeTestSuite(suiteId);
}

Manages user preferences for evaluation settings:

import { EvaluationPreferencesService } from '@memberjunction/ng-testing';
constructor(private evalPrefs: EvaluationPreferencesService) {}
getPreferences() {
return this.evalPrefs.getPreferences();
}

The package exports several TypeScript interfaces for working with test data:

  • TestTag — Tag metadata applied to test runs with optional category and color
  • TagsHelper — Utility class for parsing, serializing, and managing test tags
  • TestRunDataPoint — Analytics data point for charting test run results
  • TestAnalyticsSummary — Aggregated analytics for a time period
  • TestRunComparison — Comparison data between two test suite runs
  • TestAnalyticsFilter — Filter options for test analytics queries
  • MatrixCellData / MatrixColumnData / MatrixRowData — Data structures for the test results matrix component
PackageDescription
@memberjunction/coreCore MemberJunction framework
@memberjunction/core-entitiesEntity type definitions
@memberjunction/globalGlobal utilities and event system
@memberjunction/graphql-dataproviderGraphQL data access
@memberjunction/ng-base-typesBase Angular component types
@memberjunction/ng-code-editorCode editor component
@memberjunction/ng-container-directivesLayout directives
@memberjunction/ng-notificationsNotification system
@memberjunction/ng-sharedShared Angular utilities
@memberjunction/testing-engine-baseTesting engine core
@progress/kendo-angular-*Kendo UI components
  • @angular/common ^21.x
  • @angular/core ^21.x
  • @angular/forms ^21.x
  • @angular/platform-browser ^21.x
Terminal window
cd packages/Angular/Generic/Testing
npm run build

ISC