I want to write a unit test (test/src/rating/rating.html/dart
) for my <rating>
component (lib/rating/rating.dart/html
).
void main() {
useHtmlEnhancedConfiguration();
ng.Scope _rootScope;
dom.Element _element;
ngMock.TestBed _tb;
setUp(() {
try {
ngMock.setUpInjector();
ngMock.module((ng.Module module) {
module.install(new RatingModule());
});
ngMock.inject((ng.Scope scope, ngMock.TestBed testBed) {
_rootScope = scope;
_rootScope['rate'] = 3;
_tb = testBed;
_element = _tb.compile('<rating value="rate"></rating>', scope: _rootScope);
_rootScope.$digest();
});
print('setUp done');
} catch(e) {
print(e);
}
});
The line _element = _tb.compile('<rating value="rate>...
fails with
[Unexpected request: GET packages/bootstrap_angular/rating/rating.html
I changed the components templateUrl to template and assigned the template HTML as string and got rid of the exception.
Am I doing something wrong or is this not (yet) supported?