reportButtonAvailability.test.js 1.4 KB

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