-
Notifications
You must be signed in to change notification settings - Fork 148
Expand file tree
/
Copy pathiframe.js
More file actions
49 lines (40 loc) · 1.06 KB
/
iframe.js
File metadata and controls
49 lines (40 loc) · 1.06 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
describe('lazyloading an iframe', function() {
require('./fixtures/bootstrap.js');
beforeEach(h.clean);
afterEach(h.clean);
var fakeSrc = 'about:blank';
var realSrc = '/test/fixtures/page.html';
var test;
beforeEach(function() {
test = h.createTest({
tagName: 'iframe',
attributes: {
id: 'iframetest',
src: fakeSrc,
'data-src': realSrc,
width: 10,
height: 10,
onload: 'lzld(this)'
},
style: {
top: '5000px'
}
});
h.insertTest(test);
});
it('src currently fake', function() {
assert(test.src.indexOf(fakeSrc) !== -1);
});
it('getAttribute still gives real src', function() {
assert.equal(realSrc, test.getAttribute('src'));
});
describe('scrolling to its position', function() {
mocha.globals(['iframetest', 'navigator']);
this.timeout(10000);
beforeEach(h.scroller(0, 2500));
beforeEach(h.wait(200));
beforeEach(h.scroller(0, 5000));
beforeEach(h.wait(600));
it('loads the iframe', h.eltLoaded('iframetest'));
});
});