cellular-automata/test/app_test.dart

33 lines
812 B
Dart
Raw Permalink Normal View History

2018-07-07 13:46:40 +00:00
@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>');
});
}