All checks were successful
Test / unit-test (push) Successful in 6s
Test / build-check (push) Successful in 5s
PR Preview / teardown-preview (pull_request) Has been skipped
Test / e2e-test (push) Successful in 3m2s
PR Preview / test (pull_request) Successful in 6s
PR Preview / deploy-preview (pull_request) Successful in 15s
- 按钮从「导出PDF」改「导出Excel」,动态 import xlsx - 列:精油/英文名/会员价/零售价/容量/单价/状态 - 文件名:精油价目表YYYY-MM-DD.xlsx - 新增 e2e(按钮可见 + 点击出 toast) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
29 lines
813 B
JavaScript
29 lines
813 B
JavaScript
describe('Oil Reference Excel Export', () => {
|
|
let adminToken
|
|
|
|
before(() => {
|
|
cy.getAdminToken().then(token => { adminToken = token })
|
|
})
|
|
|
|
beforeEach(() => {
|
|
cy.visit('/oils', {
|
|
onBeforeLoad(win) {
|
|
win.localStorage.setItem('oil_auth_token', adminToken)
|
|
}
|
|
})
|
|
cy.get('.oil-chip, .oils-grid', { timeout: 10000 }).should('exist')
|
|
})
|
|
|
|
it('shows the Excel export button for admins', () => {
|
|
cy.contains('button', '📥 导出Excel').should('be.visible')
|
|
})
|
|
|
|
it('clicking Excel export shows success toast', () => {
|
|
cy.window().then(win => {
|
|
cy.stub(win.HTMLAnchorElement.prototype, 'click').returns(undefined)
|
|
})
|
|
cy.contains('button', '📥 导出Excel').click()
|
|
cy.get('.toast', { timeout: 10000 }).should('contain', '导出成功')
|
|
})
|
|
})
|