fix: e2e测试原价成本→单买成本
All checks were successful
PR Preview / test (pull_request) Has been skipped
Deploy Production / test (push) Successful in 6s
PR Preview / teardown-preview (pull_request) Successful in 14s
PR Preview / deploy-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 6s
Test / build-check (push) Successful in 3s
Deploy Production / deploy (push) Successful in 8s
Test / e2e-test (push) Successful in 3m4s

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit was merged in pull request #32.
This commit is contained in:
2026-04-14 13:22:07 +00:00
parent b1df23c04b
commit ccf96d54cd

View File

@@ -80,7 +80,7 @@ describe('Kit Export Feature', () => {
cy.get('.kit-card').first().click() cy.get('.kit-card').first().click()
cy.get('.recipe-table', { timeout: 5000 }).within(() => { 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')
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('.kit-card').first().click()
cy.get('.recipe-table tbody tr', { timeout: 5000 }).each($row => { cy.get('.recipe-table tbody tr', { timeout: 5000 }).each($row => {
const cells = $row.find('td') 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 kitCostText = cells.eq(2).text().replace(/[¥,\s]/g, '')
const origCostText = cells.eq(3).text().replace(/[¥,\s]/g, '') const origCostText = cells.eq(3).text().replace(/[¥,\s]/g, '')
const kitCost = parseFloat(kitCostText) const kitCost = parseFloat(kitCostText)