From 15f8fe6c073123f63fb5d8ff609fafaa1a405211 Mon Sep 17 00:00:00 2001 From: realtushartyagi Date: Fri, 12 Jun 2026 01:44:34 +0530 Subject: [PATCH 1/2] test(index-accessibility): verify Types Integrity & Restrictions --- types/index.accessibility.test.ts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 types/index.accessibility.test.ts diff --git a/types/index.accessibility.test.ts b/types/index.accessibility.test.ts new file mode 100644 index 000000000..ea1171534 --- /dev/null +++ b/types/index.accessibility.test.ts @@ -0,0 +1,31 @@ +import { describe, it, expectTypeOf } from 'vitest'; +import type { BadgeSize, Scale, NotificationFrequency, BadgeParams, HexColor } from './index'; + +describe('Types Integrity & Validation Tests', () => { + it('1. correctly restricts Scale to specific valid literals', () => { + expectTypeOf().toEqualTypeOf<'linear' | 'log'>(); + expectTypeOf<'invalid'>().not.toMatchTypeOf(); + }); + + it('2. properly enforces NotificationFrequency literal unions', () => { + expectTypeOf().toEqualTypeOf<'realtime' | 'daily' | 'weekly'>(); + expectTypeOf<'monthly'>().not.toMatchTypeOf(); + }); + + it('3. validates BadgeSize string unions', () => { + expectTypeOf().toEqualTypeOf<'small' | 'medium' | 'large'>(); + expectTypeOf<'xl'>().not.toMatchTypeOf(); + }); + + it('4. ensures BadgeParams defines strict types for core properties', () => { + // Instead of creating partial objects, we directly inspect the type signatures + expectTypeOf().toBeString(); + expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); + }); + + it('5. confirms HexColor utilizes branding to prevent arbitrary string assignment', () => { + // Standard unbranded strings should not perfectly match the branded HexColor type + expectTypeOf().not.toEqualTypeOf(); + }); +}); From 2ded3426eb5a198dcee6b2912fff74d5f640fe95 Mon Sep 17 00:00:00 2001 From: realtushartyagi Date: Fri, 12 Jun 2026 02:13:54 +0530 Subject: [PATCH 2/2] trigger ci restart