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

Unified Diff: third_party/pkg/angular/test/core_dom/selector_spec.dart

Issue 176943008: Update the Angular/DI tests to latest from github. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
Index: third_party/pkg/angular/test/core_dom/selector_spec.dart
diff --git a/third_party/pkg/angular/test/core_dom/selector_spec.dart b/third_party/pkg/angular/test/core_dom/selector_spec.dart
index 45554a0dc1232580be13626cb70464285fb74814..da45baa83d16db93c6ab0f7978a492c24fdb2868 100644
--- a/third_party/pkg/angular/test/core_dom/selector_spec.dart
+++ b/third_party/pkg/angular/test/core_dom/selector_spec.dart
@@ -27,6 +27,9 @@ import '../_specs.dart';
@NgDirective(selector: '[my-model][my-required]')
class _TwoDirectives {}
+@NgDirective(selector: '[two-directives]') class _OneOfTwoDirectives {}
+@NgDirective(selector: '[two-directives]') class _TwoOfTwoDirectives {}
+
main() {
describe('Selector', () {
@@ -55,7 +58,9 @@ main() {
..type(_Attribute)
..type(_Structural)
..type(_IgnoreChildren)
- ..type(_TwoDirectives);
+ ..type(_TwoDirectives)
+ ..type(_OneOfTwoDirectives)
+ ..type(_TwoOfTwoDirectives);
}));
beforeEach(inject((DirectiveMap directives) {
selector = directiveSelectorFactory(directives);
@@ -182,6 +187,14 @@ main() {
{ "selector": '[my-model][my-required]', "value": '', "element": element}
]));
});
+
+ it('should match an two directives with the same selector', () {
+ expect(selector(element = e('<div two-directives></div>')),
+ toEqualsDirectiveInfos([
+ { "selector": '[two-directives]', "value": '', "element": element},
+ { "selector": '[two-directives]', "value": '', "element": element}
+ ]));
+ });
});
}
@@ -199,7 +212,7 @@ class DirectiveInfosMatcher extends Matcher {
bool matches(directiveRefs, matchState) {
var pass = expected.length == directiveRefs.length;
if (pass) {
- for(var i = 0, ii = expected.length; i < ii; i++) {
+ for (var i = 0, ii = expected.length; i < ii; i++) {
DirectiveRef directiveRef = directiveRefs[i];
var expectedMap = expected[i];

Powered by Google App Engine
This is Rietveld 408576698