<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">

    <title><%= elementName %> test</title>

    <script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
    <script src="../../../web-component-tester/browser.js"></script>

    <link rel="import" href="../../src/<%= elementName %>/<%= elementName %>.html">
  </head>
  <body>

    <test-fixture id="BasicTestFixture">
      <template>
        <<%= elementName %>></<%= elementName %>>
      </template>
    </test-fixture>

    <test-fixture id="ChangedPropertyTestFixture">
      <template>
        <<%= elementName %> prop1="new-prop1"></<%= elementName %>>
      </template>
    </test-fixture>

    <script>
      suite('<%= elementName %>', function() {

        test('instantiating the element with default properties works', function() {
          var element = fixture('BasicTestFixture');
          assert.equal(element.prop1, '<%= elementName %>');
          var elementShadowRoot = element.shadowRoot;
          var elementHeader = elementShadowRoot.querySelector('h2');
          assert.equal(elementHeader.innerHTML, 'Hello <%= elementName %>!');
        });

        test('setting a property on the element works', function() {
          // Create a test fixture
          var element = fixture('ChangedPropertyTestFixture');
          assert.equal(element.prop1, 'new-prop1');
          var elementShadowRoot = element.shadowRoot;
          var elementHeader = elementShadowRoot.querySelector('h2');
          assert.equal(elementHeader.innerHTML, 'Hello new-prop1!');
        });

      });
    </script>


  </body>
</html>
