const fs = require('fs')
const path = require('path')
const assert = require('assert')

function read(relativePath) {
  return fs.readFileSync(path.join(__dirname, '..', relativePath), 'utf8')
}

const personalDetail = read('src/views/loanPricing/workflow/components/PersonalWorkflowDetail.vue')

assert(
  /label="最终测算利率"/.test(personalDetail),
  '个人流程详情左侧缺少“最终测算利率”标签'
)

assert(
  /return this\.retailOutput\?\.finalCalculateRate \|\| '-'/.test(personalDetail),
  '个人流程详情没有使用 finalCalculateRate 展示最终测算利率'
)

console.log('personal final calculate rate display assertions passed')
