3
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
Code distributed by Google as part of the polymer project is also
8
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
13
<meta charset="utf-8">
14
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
17
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
18
<script src="../../web-component-tester/browser.js"></script>
19
<script src="../../test-fixture/test-fixture-mocha.js"></script>
21
<link rel="import" href="../../polymer/polymer.html">
22
<link rel="import" href="../../test-fixture/test-fixture.html">
24
<link rel="import" href="../iron-doc-viewer.html">
30
"is": "awesome-sauce",
32
{"name": "isAwesome", "type": "boolean", "desc": "Is it awesome?"}
37
<test-fixture id="bound">
38
<template is="dom-template">
39
<iron-doc-viewer descriptor="{{descriptor}}" bound></iron-doc-viewer>
43
<test-fixture id="json">
44
<template is="dom-template">
45
<iron-doc-viewer json>
47
"is": "awesome-sauce",
49
{"name": "isAwesome", "type": "boolean", "desc": "Is it awesome?"}
56
<test-fixture id="json-and-bound">
57
<template is="dom-template">
58
<iron-doc-viewer descriptor="{{descriptor}}" jsonbound>
60
"is": "awesome-sauce",
62
{"name": "isAwesome", "type": "boolean", "desc": "Is it awesome?"}
72
"is": "awesome-sauce",
74
{"name": "isAwesome", "type": "boolean", "desc": "Is it awesome?"},
78
describe('<iron-doc-viewer>', function() {
81
afterEach(function() {
82
page = null; // Make sure that we don't reuse another test's element.
85
describe('with a bound descriptor', function() {
87
beforeEach(function() { page = fixture('bound', {descriptor: ELEMENT}); });
89
it('loads the descriptor', function() {
90
expect(page.descriptor.is).to.eq('awesome-sauce');
91
expect(page.descriptor.properties.length).to.eq(1);
96
describe('with a JSON descriptor', function() {
98
beforeEach(function() { page = fixture('json'); });
100
it('loads the descriptor', function() {
101
expect(page.descriptor.is).to.eq('awesome-sauce');
102
expect(page.descriptor.properties.length).to.eq(1);
107
describe('edge cases', function() {
109
// // TODO(nevir): Cannot enable until https://github.com/Polymer/polymer/issues/1200
110
// it.skip('throws when a bound and JSON descriptor are provided', function() {
111
// expect(function() {
112
// fixture('json-and-bound', {descriptor: ELEMENT});
113
// }).to.throw(Error, /descriptor/i);