From bdd96225b84589c53e845ccc1c7a562fe4216671 Mon Sep 17 00:00:00 2001 From: Gareth Johnson Date: Fri, 19 Jan 2024 11:21:06 +0000 Subject: [PATCH] Add more tag validation unit tests --- spec/core/HNamespace.spec.ts | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/spec/core/HNamespace.spec.ts b/spec/core/HNamespace.spec.ts index 02a6edc..7d7e463 100644 --- a/spec/core/HNamespace.spec.ts +++ b/spec/core/HNamespace.spec.ts @@ -1840,6 +1840,45 @@ describe('HNamespace', function (): void { ) }) + it('validates a conjunct', function (): void { + expect(() => + defs.validate( + 'mobile-phone', + new HDict({ + mobile: HMarker.make(), + phone: HMarker.make(), + device: HMarker.make(), + }) + ) + ).not.toThrow() + }) + + it('validates a marker tag', function (): void { + expect(() => + defs.validate( + 'active', + new HDict({ + active: HMarker.make(), + }) + ) + ).not.toThrow() + }) + + it('validates an airHandlingEquip for an ahu', function (): void { + expect(() => + defs.validate('airHandlingEquip', dict) + ).not.toThrow() + }) + + it('validates userAuth for a dict', function (): void { + expect(() => + defs.validate( + 'userAuth', + new HDict({ userAuth: new HDict() }) + ) + ).not.toThrow() + }) + describe('compulsory', function (): void { beforeEach(function (): void { defs.byName('dis')?.set('compulsory', HMarker.make())