feat: 套装方案对比与导出功能 #32

Merged
hera merged 37 commits from feat/kit-comparison-export into main 2026-04-14 13:32:34 +00:00
Showing only changes of commit ccf96d54cd - Show all commits

View File

@@ -80,7 +80,7 @@ describe('Kit Export Feature', () => {
cy.get('.kit-card').first().click()
cy.get('.recipe-table', { timeout: 5000 }).within(() => {
cy.contains('th', '套装成本').should('exist')
cy.contains('th', '原价成本').should('exist')
cy.contains('th', '单买成本').should('exist')
cy.contains('th', '售价').should('exist')
cy.contains('th', '利润率').should('exist')
cy.contains('th', '可做次数').should('exist')
@@ -107,7 +107,7 @@ describe('Kit Export Feature', () => {
cy.get('.kit-card').first().click()
cy.get('.recipe-table tbody tr', { timeout: 5000 }).each($row => {
const cells = $row.find('td')
// td[1] = 可做次数, td[2] = 套装成本, td[3] = 原价成本
// td[1] = 可做次数, td[2] = 套装成本, td[3] = 单买成本
const kitCostText = cells.eq(2).text().replace(/[¥,\s]/g, '')
const origCostText = cells.eq(3).text().replace(/[¥,\s]/g, '')
const kitCost = parseFloat(kitCostText)