Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit e1e7cdb

Browse files
author
Erin Altenhof-Long
committed
test(ngHint): add protractor tests based on ngHint examples
1 parent 79739ad commit e1e7cdb

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

hint_test.js

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,44 @@
11
describe('angularHint', function() {
22
describe('angular hint bootstrapping', function() {
3+
4+
beforeEach(function() {
5+
ptor = protractor.getInstance();
6+
});
7+
38
// it('should warn if ng-hint is called with unknown options', function() {
49

510
// });
611

7-
812
// it('should include all modules by ng-hint default', function() {
9-
13+
// browser.get('http://localhost:8080/e2e/allHint/#/allHint');
14+
// ptor.sleep(5000);
15+
// expect(element(by.id('title')).getText()).toBe('Angular Hint Example');
16+
// expect(element(by.id('console')).getText()).toContain('Angular best practices are to manipulate the DOM in the view.');
17+
// expect(element(by.id('console')).getText()).toContain('Directive');
1018
// });
1119

12-
1320
it('should have an inclusive mode', function() {
1421
browser.get('http://localhost:8080/e2e/inclusiveHint');
22+
ptor.sleep(5000);
1523
expect(element(by.id('title')).getText()).toBe('Inclusive Hint Example');
16-
expect(element(by.id('console')).getText().getText()).toBe('Angular best practices are to manipulate the DOM in the view. See: (https://github.com/angular/angular-hint-dom/blob/master/README.md) Expand to view manipulated properties and line numbers.');
24+
expect(element(by.id('console')).getText()).toContain('Angular best practices are to manipulate the DOM in the view.');
25+
expect(element(by.id('console')).getText()).not.toContain('Directive');
1726
});
1827

28+
it('should have an exclusive mode', function() {
29+
browser.get('http://localhost:8080/e2e/exclusiveHint');
30+
ptor.sleep(5000);
31+
expect(element(by.id('title')).getText()).toBe('Exclusive Hint Example');
32+
expect(element(by.id('console')).getText()).not.toContain('Angular best practices are to manipulate the DOM in the view.');
33+
expect(element(by.id('console')).getText()).toContain('Directive');
34+
});
1935

20-
// it('should have an exclusive mode', function() {
21-
22-
// });
23-
24-
// it('should not bootstrap if ng-hint is not included', function() {
25-
26-
// });
36+
it('should not add modules if ng-hint is not included', function() {
37+
browser.get('http://localhost:8080/e2e/noHint');
38+
ptor.sleep(5000);
39+
expect(element(by.id('title')).getText()).toBe('No Hint Example');
40+
expect(element(by.id('console')).getText()).not.toContain('Angular best practices are to manipulate the DOM in the view.');
41+
expect(element(by.id('console')).getText()).not.toContain('Directives');
42+
});
2743
});
2844
});

0 commit comments

Comments
 (0)