forked from liriliri/eruda
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinfo.js
More file actions
52 lines (44 loc) · 1.28 KB
/
info.js
File metadata and controls
52 lines (44 loc) · 1.28 KB
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
42
43
44
45
46
47
48
49
50
51
52
describe('info', function ()
{
var tool = eruda.get('info'),
$tool = $('.eruda-info');
describe('default', function ()
{
it('location', function ()
{
expect($tool.find('.eruda-content').eq(0)).toContainText(location.href);
});
it('user agent', function ()
{
expect($tool.find('.eruda-content').eq(1)).toContainText(navigator.userAgent);
});
it('device', function ()
{
expect($tool.find('.eruda-content').eq(2)).toContainText(window.innerWidth);
});
it('system', function ()
{
expect($tool.find('.eruda-content').eq(3)).toContainText('os');
});
it('about', function ()
{
expect($tool.find('.eruda-content').eq(4)).toHaveText(/Eruda v[\d.]+/);
});
});
it('clear', function ()
{
tool.clear();
expect($tool.find('li')).toHaveLength(0);
});
it('add', function ()
{
tool.add('test', 'eruda');
expect($tool.find('.eruda-title')).toContainText('test');
expect($tool.find('.eruda-content')).toContainText('eruda');
});
it('remove', function ()
{
tool.remove('test');
expect($tool.find('li')).toHaveLength(0);
});
});