reportButtonAvailability.test.js 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. const assert = require('assert');
  2. const fs = require('fs');
  3. const source = fs.readFileSync('pagesHome/components/report/generateList.vue', 'utf8');
  4. assert.match(
  5. source,
  6. /class="gbox-item-bottom-right report-button-disabled"\s+@click="showReportUnavailable\('background'\)"/
  7. );
  8. assert.match(
  9. source,
  10. /class="gbox-item-bottom-right report-button-disabled"\s+@click="showReportUnavailable\('professional'\)"/
  11. );
  12. assert.match(source, /背景报告需配合团队版评估数据生成/);
  13. assert.match(source, /教练报告需要配合团队版评估数据生成/);
  14. assert.match(source, /v-if="reportReminderShow"/);
  15. assert.match(source, /<view class="kr-title">温馨提示<\/view>/);
  16. assert.match(source, /<view class="kr-btn" @click="reportReminderShow=false">确定<\/view>/);
  17. assert.match(
  18. source,
  19. /class="gbox-item-bottom-right"\s+@click="reviewArtifact\(item, 'public'\)"\s+v-if="item\.state==1">团队报告/
  20. );
  21. assert.match(
  22. source,
  23. /class="gbox-item-bottom-right"\s+@click="reviewArtifact\(item, 'background'\)"\s+v-if="item\.state==1">背景报告/
  24. );
  25. assert.match(
  26. source,
  27. /class="gbox-item-bottom-right"\s+@click="reviewArtifact\(item, 'professional'\)"\s+v-if="item\.state==1">教练报告/
  28. );
  29. console.log('reportButtonAvailability.test.js: all assertions passed');