This repository was archived by the owner on May 19, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 139
Expand file tree
/
Copy pathfirebase-database-behavior.html
More file actions
83 lines (69 loc) · 2.22 KB
/
firebase-database-behavior.html
File metadata and controls
83 lines (69 loc) · 2.22 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!doctype html>
<!--
@license
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file or at
https://github.com/firebase/polymerfire/blob/master/LICENSE
-->
<html>
<head>
<meta charset="UTF-8">
<title>FirebaseDatabaseBehavior 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>
<link rel="import" href="../../app-storage/test/app-storage-compatibility-suite.html">
<link rel="import" href="../firebase-database-behavior.html">
<link rel="import" href="../firebase-app.html">
</head>
<body>
<firebase-app
name="test"
api-key="AIzaSyDTP-eiQezleFsV2WddFBAhF_WEzx_8v_g"
auth-domain="polymerfire-test.firebaseapp.com"
database-url="https://polymerfire-test.firebaseio.com">
</firebase-app>
<test-fixture id="BasicDatabase">
<template>
<x-firebase-database app-name="test"></x-firebase-database>
</template>
</test-fixture>
<test-fixture id="PathedDatabase">
<template>
<x-firebase-database app-name="test" path="/foo"></x-firebase-database>
</template>
</test-fixture>
<script>
HTMLImports.whenReady(function() {
Polymer({
is: 'x-firebase-database',
behaviors: [
Polymer.FirebaseDatabaseBehavior
]
});
});
suite('FirebaseDatabaseBehavior', function() {
var databaseElement;
suite('with a configured app', function() {
setup(function() {
databaseElement = fixture('BasicDatabase');
});
test('has a database instance', function() {
expect(databaseElement.db).to.be.ok;
});
test('does not have a ref by default', function() {
expect(databaseElement.ref).to.not.be.ok;
});
suite('and a path', function() {
setup(function() {
databaseElement = fixture('PathedDatabase');
});
test('has a ref instance', function() {
expect(databaseElement.ref).to.be.ok;
});
});
});
});
</script>
</body>