<!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>oi-beacon-request-app test</title>

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

    <link rel="import" href="../../src/oi-beacon-request-app/oi-beacon-request-app.html">
  </head>
  <body>

    <test-fixture id="BasicTestFixture">
      <template>
        <oi-beacon-request-app></oi-beacon-request-app>
      </template>
    </test-fixture>

    <test-fixture id="ChangedPropertyTestFixture">
      <template>
        <oi-beacon-request-app prop1="new-prop1"></oi-beacon-request-app>
      </template>
    </test-fixture>

    <script>
      suite('oi-beacon-request-app', function() {

        test('instantiating the element with default properties works', function() {
          var element = fixture('BasicTestFixture');
          assert.equal(element.prop1, 'oi-beacon-request-app');
          var elementShadowRoot = element.shadowRoot;
          var elementHeader = elementShadowRoot.querySelector('h2');
          assert.equal(elementHeader.innerHTML, 'Hello oi-beacon-request-app!');
        });

        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>
