/**
 * 项目账号数据模型单元测试
 *
 * @author CaiAoLin
 * @date 2017/11/20
 * @version
 */

'use strict';

const { app, assert } = require('egg-mock/bootstrap');

describe('test/app/service/project_account.test.js', () => {

    it('test login success (sso)', function* () {
        const ctx = app.mockContext();
        const postData = {
            account: 'laiku123@qq.com',
            project: 'J201711163164',
            project_password: '19930523',
        };
        ctx.session = {};
        const result = yield ctx.service.projectAccount.accountLogin(postData, 2);
        assert(result);
    });

    // it('test login success (local)', function* () {
    //     const ctx = app.mockContext();
    //     const postData = {
    //         account: 'test',
    //         project: 'Y201711167257',
    //         project_password: '123123',
    //     };
    //
    //     const result = yield ctx.service.projectAccount.accountLogin(postData);
    //     assert(result);
    // });
    //
    // it('test login fail', function* () {
    //     const ctx = app.mockContext();
    //     const postData = {
    //         account: 'laiku123@qq.com',
    //         project: 'J201711163164',
    //         project_password: '1111',
    //     };
    //
    //     const result = yield ctx.service.projectAccount.accountLogin(postData);
    //     assert(!result);
    // });
});
