mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-21 15:51:05 +00:00
渠道定价条目价格留空时按各模型官方默认价回退计费,但向这类条目追加 模型时,前端会用「第一个新增模型」的默认价回填整条价格字段,保存后 条目内所有模型被静默统一成同一个价格,造成少计费或多计费。 自动填充现在只作用于「空条目首次加入单个模型」:条目已有模型时追加、 或一次加入多个模型时都不再改写价格,留空条目继续按各模型默认价回退。 - 新增 PricingEntryCard.modelDefaultPrice.spec.ts 覆盖 4 种场景 - 把该 spec 加入 Makefile 的 FRONTEND_CRITICAL_VITEST,使 CI 覆盖该回归 Closes #7796
51 lines
1.9 KiB
Makefile
51 lines
1.9 KiB
Makefile
.PHONY: build build-backend build-frontend test test-backend test-frontend test-frontend-critical
|
||
|
||
FRONTEND_CRITICAL_VITEST := \
|
||
src/i18n/__tests__/localeKeyCompleteness.spec.ts \
|
||
src/api/__tests__/client.spec.ts \
|
||
src/api/__tests__/tokenRefresh.spec.ts \
|
||
src/api/__tests__/keys.bulkUpdate.spec.ts \
|
||
src/components/account/__tests__/OpenAIReferralCell.spec.ts \
|
||
src/components/account/__tests__/OpenAIReferralCell.transport.spec.ts \
|
||
src/components/account/__tests__/OpenAIQuotaResetCell.spark_shadow.spec.ts \
|
||
src/components/keys/__tests__/BulkEditKeysModal.spec.ts \
|
||
src/components/admin/user/__tests__/UserPlatformQuotaModal.spec.ts \
|
||
src/views/user/__tests__/KeysView.spec.ts \
|
||
src/api/__tests__/channelMonitorV2.spec.ts \
|
||
src/views/auth/__tests__/LinuxDoCallbackView.spec.ts \
|
||
src/views/auth/__tests__/WechatCallbackView.spec.ts \
|
||
src/views/user/__tests__/PaymentView.spec.ts \
|
||
src/views/user/__tests__/PaymentResultView.spec.ts \
|
||
src/views/user/__tests__/ChannelStatusView.mode.spec.ts \
|
||
src/components/user/profile/__tests__/ProfileInfoCard.spec.ts \
|
||
src/views/admin/__tests__/SettingsView.spec.ts \
|
||
src/features/channel-monitor-v2/__tests__/designSystem.structure.spec.ts \
|
||
src/features/channel-monitor-v2/__tests__/monitorFormat.spec.ts \
|
||
src/features/channel-monitor-v2/__tests__/monitorZoom.spec.ts \
|
||
src/components/admin/channel/__tests__/PricingEntryCard.modelDefaultPrice.spec.ts
|
||
|
||
# 一键编译前后端
|
||
build: build-backend build-frontend
|
||
|
||
# 编译后端(复用 backend/Makefile)
|
||
build-backend:
|
||
@$(MAKE) -C backend build
|
||
|
||
# 编译前端(需要已安装依赖)
|
||
build-frontend:
|
||
@pnpm --dir frontend run build
|
||
|
||
# 运行测试(后端 + 前端)
|
||
test: test-backend test-frontend
|
||
|
||
test-backend:
|
||
@$(MAKE) -C backend test
|
||
|
||
test-frontend:
|
||
@pnpm --dir frontend run lint:check
|
||
@pnpm --dir frontend run typecheck
|
||
@$(MAKE) test-frontend-critical
|
||
|
||
test-frontend-critical:
|
||
@pnpm --dir frontend exec vitest run $(FRONTEND_CRITICAL_VITEST)
|