Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Commit

Permalink
feat(event_spec): Add aaddTest to run an event test in an iit
Browse files Browse the repository at this point in the history
  • Loading branch information
jbdeboer committed Apr 2, 2014
1 parent 479ef4d commit a599986
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions test/directive/ng_events_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ library ng_events_spec;
import '../_specs.dart';
import 'dart:html' as dom;

void addTest(String name, [String eventType='MouseEvent', String eventName]) {
void addTest(String name, [String eventType='MouseEvent', String eventName, exclusive=false]) {
if (eventName == null) {
eventName = name;
}

describe('ng-$name', () {
var describeBody = () {
TestBed _;

beforeEach((TestBed tb) => _ = tb);
Expand All @@ -19,7 +19,17 @@ void addTest(String name, [String eventType='MouseEvent', String eventName]) {
expect(_.rootScope.context['abc']).toEqual(true);
expect(_.rootScope.context['event'] is dom.UIEvent).toEqual(true);
});
});
};

if (exclusive) {
ddescribe('ng-$name', describeBody);
} else {
describe('ng-$name', describeBody);
}
}

void aaddTest(String name, [String eventType='MouseEvent', String eventName]) {
addTest(name, eventType, eventName, true);
}

main() {
Expand Down

0 comments on commit a599986

Please sign in to comment.