|
| 1 | +'use strict'; |
| 2 | + |
| 3 | +/** |
| 4 | + * This scenario checks if the usage section for selected directives is rendered correctly |
| 5 | + */ |
| 6 | + |
| 7 | +describe('usage section', function() { |
| 8 | + |
| 9 | + describe('as attribute', function() { |
| 10 | + |
| 11 | + fdescribe('should list the directive name', function() { |
| 12 | + |
| 13 | + it('when directive name is a parameter with a value', function() { |
| 14 | + browser.get('build/docs/index.html#!/api/ng/directive/ngModel'); |
| 15 | + |
| 16 | + // Ensure that ngModel appears as an argument |
| 17 | + var args = element(by.className('input-arguments')); |
| 18 | + |
| 19 | + var paramNames = args.all(by.css('tr td:nth-child(1)')); |
| 20 | + |
| 21 | + expect(paramNames.getText()).toContain('ngModel'); |
| 22 | + |
| 23 | + var usage = element(by.className('usage')); |
| 24 | + |
| 25 | + expect(usage.isPresent()).toBe(true); |
| 26 | + |
| 27 | + var asAttribute = usage.element(by.cssContainingText('li', 'as attribute')); |
| 28 | + |
| 29 | + expect(asAttribute.isPresent()).toBe(true); |
| 30 | + |
| 31 | + expect(asAttribute.element(by.cssContainingText('span', 'ng-model')).isPresent()).toBe(true); |
| 32 | + }); |
| 33 | + |
| 34 | + |
| 35 | + it('when directive name is a void parameter', function() { |
| 36 | + browser.get('build/docs/index.html#!/api/ngRoute/directive/ngView'); |
| 37 | + |
| 38 | + // Ensure that ngView does not appear as an argument |
| 39 | + var args = element(by.className('input-arguments')); |
| 40 | + |
| 41 | + var paramNames = args.all(by.css('tr td:nth-child(1)')); |
| 42 | + |
| 43 | + expect(paramNames.getText()).not.toContain('ngView'); |
| 44 | + |
| 45 | + var usage = element(by.className('usage')); |
| 46 | + |
| 47 | + expect(usage.isPresent()).toBe(true); |
| 48 | + |
| 49 | + var asAttribute = usage.element(by.cssContainingText('li', 'as attribute')); |
| 50 | + |
| 51 | + expect(asAttribute.isPresent()).toBe(true); |
| 52 | + |
| 53 | + expect(asAttribute.element(by.cssContainingText('span', 'ng-view')).isPresent()).toBe(true); |
| 54 | + }); |
| 55 | + |
| 56 | + }); |
| 57 | + }); |
| 58 | +}); |
0 commit comments