From 2db97e8e297f2f74e943f21373f728cc0d78c44d Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 10:53:55 +0000 Subject: [PATCH] test(contacts): add missing tests for contactsById dictionary Co-authored-by: Sparkier <5690524+Sparkier@users.noreply.github.com> --- src/lib/contacts.spec.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lib/contacts.spec.ts b/src/lib/contacts.spec.ts index 3a54ce5..ff92eec 100644 --- a/src/lib/contacts.spec.ts +++ b/src/lib/contacts.spec.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from 'vitest'; -import { contacts } from './contacts'; +import { contacts, contactsById } from './contacts'; describe('contacts', () => { it('should be a non-empty array of objects', () => { @@ -28,3 +28,15 @@ describe('contacts', () => { }); }); }); + +describe('contactsById', () => { + it('should contain the same number of items as contacts array', () => { + expect(Object.keys(contactsById).length).toBe(contacts.length); + }); + + it('should map each contact id to its corresponding contact object', () => { + contacts.forEach((contact) => { + expect(contactsById[contact.id]).toBe(contact); + }); + }); +});