import { describe, expect, it } from 'vitest'; import { quantityTargetNames } from '../src/core/quantity-scope'; const piers = [ { name: 'P1', hasModel: true }, { name: 'P2', hasModel: true }, { name: 'P3', hasModel: false }, ]; describe('quantityTargetNames (④ 재료표 범위)', () => { it('is every pier with a model when 전체 is on', () => { expect(quantityTargetNames(piers, true, 'P2')).toEqual(['P1', 'P2']); }); it('is only the chosen pier when 전체 is off', () => { expect(quantityTargetNames(piers, false, 'P2')).toEqual(['P2']); }); it('is empty when the chosen pier has no model', () => { expect(quantityTargetNames(piers, false, 'P3')).toEqual([]); }); it('is empty when no pier is chosen and 전체 is off', () => { expect(quantityTargetNames(piers, false, null)).toEqual([]); }); });