ldap-clients
Version:
45 lines (40 loc) • 1.15 kB
JavaScript
import $ from 'jquery'
import init from '../../init'
import Util from '../../TestUtil'
import Vue from 'vue'
describe('登录测试', () => {
let vm = null
before(() => {
init()
vm = Util.createTest('login', {msg: '测试标题'})
})
after(function () {
Util.destroyVM(vm)
})
it('组件能够正确显示', () => {
expect($(vm.$el).html().substring(29, 38)).to.contain('这是大标题管理系统')
})
it('可以登录', (done) => {
vm.ename = 1
vm.password = 1
let path = `/rs/user/1/1/系统管理`
Vue.http({url: path, method: 'GET'}).then((ret) => {
expect(ret.data.name).to.equals('超级管理员')
done()
}).catch((ret) => {
console.log(ret)
expect(true).to.equals(false)
done()
})
})
/* it('内含组件能够正确显示', () => {
expect($(vm.$el).html()).to.contain('Welcom')
})
it('组件参数能够正确传递', done => {
// expect(vm.msg).to.equals('测试标题')
vm.$nextTick(() => {
expect($(vm.$el).html()).to.contain('测试标题')
done()
})
}) */
})