Files
Aislo/B07_DesignDetail/openwebcad/test/entities/rectangle/rectangle.test.ts
T
eomsangdonandClaude Fable 5 6e195afb69 feat(B07,B08): 워크플로 순서 교환 — 상세설계를 수량산출 앞으로
횡단설계(B06) 다음을 상세설계 → 수량산출 → 설계도서 순으로 재배열하고,
폴더 번호가 흐름과 일치하도록 이름을 맞바꾼다.

- B08_DesignDetail → B07_DesignDetail, B07_Quantity → B08_Quantity
  (파일 접두어·식별자·라우트·locale 키 전량 스왑)
- STAGE_KEYS 4=DESIGN_DETAIL, 5=QUANTITY 스왑 + 라우터 stage 리터럴 교체
- CAD 마운트 /b08-cad → /b07-cad (main.py·vite proxy·iframe URL),
  openwebcad Toolbar 라벨 B07로 수정 후 재빌드
- 유지: openwebcad postMessage 프로토콜 aislo:b08:*·패키지명(내부 식별자)
- 기존 프로젝트 storage 폴더 rename + project_manifest 갱신,
  DB project_workflow_stages stage_no 4↔5 행 스왑 완료

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-29 16:16:46 +09:00

41 lines
1.7 KiB
TypeScript

/* eslint-disable @typescript-eslint/no-explicit-any */
/*
* Draw a rectangle to the screen and check if the json export contains the correct data using the vitest testing framework
*/
import {expect, test} from 'vitest';
import {EntityName, type JsonEntity} from '../../../src/entities/Entity';
import type {RectangleJsonData} from '../../../src/entities/RectangleEntity';
import {getEntities} from '../../../src/state';
import {Tool} from '../../../src/tools';
import {click} from '../../helpers/click';
import {initApplication} from '../../helpers/init-application';
import {setActiveTool} from '../../helpers/set-active-tool';
import {CANVAS_HEIGHT} from '../../helpers/tests.consts';
test('Draw circle', async () => {
const inputController = initApplication();
setActiveTool(Tool.RECTANGLE);
click(inputController, 185, 94);
click(inputController, 740, 395);
const entities = getEntities();
const rectangleEntity = entities[0];
expect(rectangleEntity.getType()).toBe(EntityName.Rectangle);
const rectangleJson = (await rectangleEntity.toJson()) as JsonEntity<RectangleJsonData>;
expect(rectangleJson.lineColor).toBe('#fff');
expect(rectangleJson.lineWidth).toBe(1);
expect(rectangleJson.type).toBe('Rectangle');
expect(rectangleJson.shapeData.points[0].x).toBe(185);
expect(rectangleJson.shapeData.points[0].y).toBe(CANVAS_HEIGHT - 395);
expect(rectangleJson.shapeData.points[1].x).toBe(185);
expect(rectangleJson.shapeData.points[1].y).toBe(CANVAS_HEIGHT - 94);
expect(rectangleJson.shapeData.points[2].x).toBe(740);
expect(rectangleJson.shapeData.points[2].y).toBe(CANVAS_HEIGHT - 94);
expect(rectangleJson.shapeData.points[3].x).toBe(740);
expect(rectangleJson.shapeData.points[3].y).toBe(CANVAS_HEIGHT - 395);
});