Set up Basic AngularDart Structure
This commit is contained in:
parent
fffcc3fbae
commit
f3dfc3b368
7 changed files with 193 additions and 32 deletions
32
test/app_test.dart
Normal file
32
test/app_test.dart
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
@TestOn('browser')
|
||||
|
||||
import 'package:rules_of_living/app_component.dart';
|
||||
import 'package:rules_of_living/app_component.template.dart' as ng;
|
||||
import 'package:angular_test/angular_test.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
final testBed =
|
||||
NgTestBed.forComponent<AppComponent>(ng.AppComponentNgFactory);
|
||||
NgTestFixture<AppComponent> fixture;
|
||||
|
||||
setUp(() async {
|
||||
fixture = await testBed.create();
|
||||
});
|
||||
|
||||
tearDown(disposeAnyRunningTest);
|
||||
|
||||
test('Default greeting', () {
|
||||
expect(fixture.text, 'Hello Angular');
|
||||
});
|
||||
|
||||
test('Greet world', () async {
|
||||
await fixture.update((c) => c.name = 'World');
|
||||
expect(fixture.text, 'Hello World');
|
||||
});
|
||||
|
||||
test('Greet world HTML', () {
|
||||
final html = fixture.rootElement.innerHtml;
|
||||
expect(html, '<h1>Hello Angular</h1>');
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue