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

Unified Diff: test/data/input/component_field_2way_test.html

Issue 12225039: Support for observable models, fixes #259 (Closed) Base URL: https://github.com/dart-lang/web-ui.git@master
Patch Set: Created 7 years, 10 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
« no previous file with comments | « test/data/input/common.dart ('k') | test/data/input/component_field_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/data/input/component_field_2way_test.html
diff --git a/test/data/input/component_field_2way_test.html b/test/data/input/component_field_2way_test.html
index 52be12870653ac032b797db54eb45b8a828e34fc..3ea62ae1cc348f118ca6870382e0209149395b3b 100644
--- a/test/data/input/component_field_2way_test.html
+++ b/test/data/input/component_field_2way_test.html
@@ -16,11 +16,18 @@
<template></template>
<script type='application/dart'>
import 'package:web_ui/web_ui.dart';
+ @observable
class Greeter extends WebComponent {
String greetIng;
+
+ // TODO(jmesserly): original test was testing for the "title" DOM
+ // property. Unfortunately it can't be observed, so we'll use
+ // a different property.
+ String title2;
+
changeStuff() {
greetIng = 'Yo dawg';
- title = 'I heard you like $title so we put $title in yo $title.';
+ title2 = 'I heard you like $title2 so we put $title2 in yo $title2.';
}
}
</script>
@@ -30,7 +37,7 @@
</p>
<!-- Note: "title" is a DOM field on all elements.
Also this element has no rendering. -->
- <x-greeter id="greet" bind-title="data[1]" bind-greet-ing="data[0]">
+ <x-greeter id="greet" bind-title2="data[1]" bind-greet-ing="data[0]">
</x-greeter>
<p id="actual">{{data[0]}} {{data[1]}}</p>
<script type="application/dart">
@@ -38,14 +45,15 @@
import 'package:unittest/unittest.dart';
import 'package:web_ui/web_ui.dart';
- var data = ['hello', 'world'];
+ final data = toObservable(['hello', 'world']);
+
main() {
window.setTimeout(() {
var actual = query('#actual');
var greet = query('#greet');
expect(actual.innerHtml, 'hello world');
greet.xtag.changeStuff();
- dispatch();
+ deliverChangesSync();
expect(actual.innerHtml, contains('Yo dawg I heard'));
window.postMessage('done', '*');
}, 0);
« no previous file with comments | « test/data/input/common.dart ('k') | test/data/input/component_field_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698