import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import { greetingForBrand } from '../src/flows/greetingSelector.js'; import { GREETINGS } from '../src/constants.js'; describe('greetingForBrand', () => { it('returns the correct file+label for a known brand', () => { const result = greetingForBrand({ brand: 'Aerie', storeNumber: 792 }); assert.equal(result.file, GREETINGS.Aerie.file); assert.equal(result.fileName, '792 - Aerie Greeting.wav'); }); it('picks the American Eagle greeting for the AE brand', () => { const result = greetingForBrand({ brand: 'American Eagle Outfitters', storeNumber: 499, }); assert.equal(result.file, GREETINGS['American Eagle Outfitters'].file); assert.equal(result.fileName, '499 - AE Greeting.wav'); }); it('falls back to the AE greeting for unknown brands', () => { const result = greetingForBrand({ brand: 'MysteryBrand', storeNumber: 42 }); assert.equal(result.file, GREETINGS['American Eagle Outfitters'].file); // Filename still reflects the caller's storeNumber and the AE label. assert.equal(result.fileName, '42 - AE Greeting.wav'); }); });