paper-fab-speed-dial.html
1.73 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
53
54
55
56
57
58
59
60
61
62
63
64
65
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>paper-fab-speed-dial tests</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<script src="../../test-fixture/test-fixture-mocha.js"></script>
<script src="../../iron-test-helpers/mock-interactions.js"></script>
<link rel="import" href="../../paper-fab/paper-fab.html">
<link rel="import" href="../paper-fab-speed-dial.html">
<link rel="import" href="../../test-fixture/test-fixture.html">
</head>
<body>
<test-fixture id="SpeedDial">
<template>
<paper-fab-speed-dial>
<paper-fab class="dropdown-trigger"></paper-fab>
<div class="dropdown-content">content</div>
</paper-fab-morph>
</template>
</test-fixture>
<script>
suite('<paper-fab-speed-dial>', function() {
suite('basic', function() {
var trigger;
var content;
var dropdown;
setup(function() {
var morph = fixture('SpeedDial');
trigger = Polymer.dom(morph).querySelector('.dropdown-trigger');
dropdown = morph.querySelector('iron-dropdown');
});
test('dropdown is initially closed', function() {
expect(dropdown.opened).to.be.equal(false);
});
test('tapping the trigger opens the dropdown', function(done) {
MockInteractions.downAndUp(trigger, function() {
Polymer.Base.async(function() {
expect(dropdown.opened).to.be.equal(true);
done();
}, 100);
});
});
});
});
</script>
</body>
</html>