project_account.test.js 812 B

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * 项目账号业务逻辑单元测试
  3. *
  4. * @author CaiAoLin
  5. * @date 2017/11/15
  6. * @version
  7. */
  8. 'use strict';
  9. const { app, assert } = require('egg-mock/bootstrap');
  10. describe('test/app/service/project_account.test.js', () => {
  11. it('get account in not exist project', function* () {
  12. const ctx = app.mockContext();
  13. ctx.service.projectAccount.searchFilter({});
  14. const accountList = yield ctx.service.projectAccount.getAccountByProjectId(1000);
  15. assert(accountList.length === 0);
  16. });
  17. it('get account in project', function* () {
  18. const ctx = app.mockContext();
  19. ctx.service.projectAccount.searchFilter({});
  20. const accountList = yield ctx.service.projectAccount.getAccountByProjectId(5);
  21. assert(accountList.length > 0);
  22. });
  23. });