forked from easemob/web-im
-
Notifications
You must be signed in to change notification settings - Fork 0
/
indextest.jsx
41 lines (31 loc) · 1.11 KB
/
indextest.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// require('./web/index.html')
// require('app/main.jsx')
//
describe('login test', function () {
beforeEach(function () {
var root = document.createElement('div')
root.id = 'smartadmin-root'
document.body.appendChild(root)
});
beforeEach(function () {
require('app/main.jsx')
})
it(" when login button clicked , page should redirect to / ", function (done) {
// expect(window.location.hash).toBe('#/login')
setTimeout(() => {
$('[name="username"]').val('easemobevaadmin')
$('[name="password"]').val('evaadmin$*@^$(')
let verify = $(".btn-verify").text()
let verifyArray = verify.split("+")
let sumVerify = verifyArray.reduce((a, b) => parseInt(a) + parseInt(b))
$('[name="verification"]').val(sumVerify)
$('[type="submit"]').click()
setTimeout(() => {
console.log('done')
expect(window.location.hash).toBe('#/')
done()
}, 1000)
}, 1000)
})
})
console.log(window.innerHeight)