Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: appengine/config_service/ui/test/luci-config-ui/luci-config-ui_test.html

Issue 2923973003: Added base template for config ui. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/config_service/ui/test/luci-config-ui/luci-config-ui_test.html
diff --git a/appengine/config_service/ui/test/luci-config-ui/luci-config-ui_test.html b/appengine/config_service/ui/test/luci-config-ui/luci-config-ui_test.html
new file mode 100644
index 0000000000000000000000000000000000000000..695b094c25d8ac1e975024131b726f789bff506a
--- /dev/null
+++ b/appengine/config_service/ui/test/luci-config-ui/luci-config-ui_test.html
@@ -0,0 +1,53 @@
+<!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>luci-config-ui test</title>
+
+ <script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
+ <script src="../../../web-component-tester/browser.js"></script>
+
+ <link rel="import" href="../../src/luci-config-ui/luci-config-ui.html">
+ </head>
+ <body>
+
+ <test-fixture id="BasicTestFixture">
+ <template>
+ <luci-config-ui></luci-config-ui>
+ </template>
+ </test-fixture>
+
+ <test-fixture id="ChangedPropertyTestFixture">
+ <template>
+ <luci-config-ui prop1="new-prop1"></luci-config-ui>
+ </template>
+ </test-fixture>
+
+ <script>
+ suite('luci-config-ui', function() {
+
+ test('instantiating the element with default properties works', function() {
+ var element = fixture('BasicTestFixture');
+ assert.equal(element.prop1, 'luci-config-ui');
+ var elementShadowRoot = element.shadowRoot;
+ var elementHeader = elementShadowRoot.querySelector('h2');
+ assert.equal(elementHeader.innerHTML, 'Hello luci-config-ui!');
+ });
+
+ 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!');
Sergey Berezin (google) 2017/06/07 19:14:55 Does this pass? I don't see how the header in the
+ });
+
+ });
+ </script>
+
+
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698