wulf-pulse/lib/services/rmm/target-resolver.test.ts
lorentz 1112a06afe feat: RMM Overshell, IT Glue audit/write-back, LogLift, link-aware bundles, dashboard overhaul
- RMM Overshell (migration 077): admin page, dispatch UI, executor/worker, target
  resolver, script registry (AD/DHCP/DNS/event-log/services/software/network/loglift)
- LogLift evidence pipeline (migration 078): upload webhook, B2 storage client,
  receiver/matcher, EventLogCollector PowerShell script
- IT Glue audit + write-back (migrations 075, 076): asset-audit runner, ticket
  xrefs, applications/configurations browse pages + apply/revert/audit endpoints
- Link-aware analyzer bundles (migration 073) + provider toggle (migration 074):
  link-discovery service, OpenRouter LLM provider, related-tickets/itglue-suggestion
  panels, analyze-bundle endpoint
- Endpoint data model + device-link reconciliation (migrations 079, 080): conflicts
  admin page, reconciler service, resolve endpoints
- Dashboard overhaul: integration-health service + alerts, overview/health endpoints
- Permissions: add itglue + rmm scopes; middleware: public /api/rmm/loglift route

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 07:13:18 -04:00

23 lines
843 B
TypeScript

import { describe, it, expect } from 'vitest';
import { _TARGET_RESOLVER_INTERNALS } from './target-resolver';
describe('WNP_REGEX', () => {
const re = _TARGET_RESOLVER_INTERNALS.WNP_REGEX;
it('matches the canonical 11-char Wulf Nurse pattern', () => {
expect(re.test('YNGHYNWNP01')).toBe(true);
expect(re.test('FOSSUPWNP02')).toBe(true);
expect(re.test('TARBBPWNP09')).toBe(true);
});
it('case-insensitive on the literal portion', () => {
expect(re.test('ynghynwnp01')).toBe(true);
});
it('rejects mismatched lengths or shapes', () => {
expect(re.test('YNGHYNWNP1')).toBe(false); // 1 digit suffix
expect(re.test('YNGHYNWNP123')).toBe(false); // 3 digit suffix
expect(re.test('YNGHYNWN01')).toBe(false); // missing P
expect(re.test('YNHYNWNP01')).toBe(false); // 5 letters before WNP
});
});