UNPKG

@inq/keypad-input

Version:

Keypad input for Touchscreen devices like a Kiosk

56 lines (45 loc) 1.9 kB
<!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>keypad-input test</title> <script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script> <script src="../node_modules/@polymer/test-fixture/test-fixture.js"></script> <script src="../node_modules/mocha/mocha.js"></script> <script src="../node_modules/chai/chai.js"></script> <script src="../node_modules/wct-mocha/wct-mocha.js"></script> <script type="module" src="../keypad-input.js"></script> </head> <body> <test-fixture id="BasicTestFixture"> <template> <keypad-input></keypad-input> </template> </test-fixture> <test-fixture id="ChangedPropertyTestFixture"> <template> <keypad-input prop1="new-prop1"></keypad-input> </template> </test-fixture> <script type="module"> suite('keypad-input', () => { test('instantiating the element with default properties works', () => { const element = fixture('BasicTestFixture'); assert.equal(element.prop1, 'keypad-input'); const elementShadowRoot = element.shadowRoot; const elementHeader = elementShadowRoot.querySelector('h2'); assert.equal(elementHeader.innerHTML, 'Hello keypad-input!'); }); test('setting a property on the element works', () => { // Create a test fixture const element = fixture('ChangedPropertyTestFixture'); assert.equal(element.prop1, 'new-prop1'); const elementShadowRoot = element.shadowRoot; const elementHeader = elementShadowRoot.querySelector('h2'); assert.equal(elementHeader.innerHTML, 'Hello new-prop1!'); }); }); </script> </body> </html>