Files
Pier_v1/tests/quantity-scope.test.ts
T
CopilotandCopilot 06e1b97a62
ITAM Code Check / build-and-config-check (push) Failing after 37s
ITAM Docker Build Check / docker-build-check (push) Failing after 1m0s
교각 프로그램 초기 버전
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 15:55:01 +09:00

27 lines
849 B
TypeScript

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([]);
});
});