feat(quantity): ④ 재료표 범위를 교각 목록의 선택과 맞춤 (전체 또는 고른 교각)
- 교각 목록 맨 위에 "전체 (N기)" 항목 추가 (기본 선택) - 교각 이름을 누르면 그 교각의 재료표만 표시, 제목·합계 문구도 그 교각 기준 - 범위 규칙을 core/quantity-scope.ts로 분리하고 테스트 4건 추가 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
278d19faa5
commit
7861bc3fdf
4 files changed
+58
-3
No files matched your search
@@ -0,0 +1,26 @@
|
||||
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([]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user