UNPKG

@cwmr/paper-fab-speed-dial

Version:

A Material Design - Floating Action Button with Speed Dial (Polymer)

54 lines (43 loc) 1.47 kB
<!doctype html> <html> <head> <title>paper-fab-speed-dial</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script> <script src="../node_modules/wct-browser-legacy/browser.js"></script> <script src="../node_modules/@polymer/test-fixture/test-fixture-mocha.js"></script> <script type="module" src="../paper-fab-speed-dial.js"></script> <script type="module" src="../node_modules/@polymer/test-fixture/test-fixture.js"></script> </head> <body> <test-fixture id="TrivialElement"> <template> <paper-fab-speed-dial></paper-fab-speed-dial> </template> </test-fixture> <script type="module"> suite('<paper-fab-speed-dial>', () => { suite('open/close behavior', () => { var element; setup(() => { element = fixture('TrivialElement'); }); test('defaults to closed', () => { expect(element.opened).to.be.eql(false); }); test('is opened when calling open()', () => { element.open(); expect(element.opened).to.be.eql(true); }); test('is opened when calling open()', () => { element.open(); expect(element.opened).to.be.eql(true); // Check pre-condition element.close(); expect(element.opened).to.be.eql(false); }); }); }); </script> </body> </html>