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

Commit 0822d34

Browse files
committed
refactor(api-pages.scenario.js): remove misleading describe block
1 parent 8727302 commit 0822d34

File tree

1 file changed

+30
-33
lines changed

1 file changed

+30
-33
lines changed

Diff for: docs/app/e2e/api-docs/api-pages.scenario.js

+30-33
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,48 @@
11
'use strict';
22

3-
describe('doc.angularjs.org', function() {
3+
describe('API pages', function() {
44

5-
describe('API pages', function() {
5+
it('should display links to code on GitHub', function() {
6+
browser.get('build/docs/index.html#!/api/ng/service/$http');
7+
expect(element(by.css('.improve-docs')).getAttribute('href')).toMatch(/https?:\/\/github\.com\/angular\/angular\.js\/edit\/.+\/src\/ng\/http\.js/);
68

7-
it('should display links to code on GitHub', function() {
8-
browser.get('build/docs/index.html#!/api/ng/service/$http');
9-
expect(element(by.css('.improve-docs')).getAttribute('href')).toMatch(/https?:\/\/github\.com\/angular\/angular\.js\/edit\/.+\/src\/ng\/http\.js/);
10-
11-
browser.get('build/docs/index.html#!/api/ng/service/$http');
12-
expect(element(by.css('.view-source')).getAttribute('href')).toMatch(/https?:\/\/github\.com\/angular\/angular\.js\/tree\/.+\/src\/ng\/http\.js#L\d+/);
13-
});
9+
browser.get('build/docs/index.html#!/api/ng/service/$http');
10+
expect(element(by.css('.view-source')).getAttribute('href')).toMatch(/https?:\/\/github\.com\/angular\/angular\.js\/tree\/.+\/src\/ng\/http\.js#L\d+/);
11+
});
1412

15-
it('should change the page content when clicking a link to a service', function() {
16-
browser.get('build/docs/index.html');
13+
it('should change the page content when clicking a link to a service', function() {
14+
browser.get('build/docs/index.html');
1715

18-
var ngBindLink = element(by.css('.definition-table td a[href="api/ng/directive/ngClick"]'));
19-
ngBindLink.click();
16+
var ngBindLink = element(by.css('.definition-table td a[href="api/ng/directive/ngClick"]'));
17+
ngBindLink.click();
2018

21-
var mainHeader = element(by.css('.main-body h1 '));
22-
expect(mainHeader.getText()).toEqual('ngClick');
23-
});
19+
var mainHeader = element(by.css('.main-body h1 '));
20+
expect(mainHeader.getText()).toEqual('ngClick');
21+
});
2422

2523

26-
it('should show the functioning input directive example', function() {
27-
browser.get('build/docs/index.html#!/api/ng/directive/input');
24+
it('should show the functioning input directive example', function() {
25+
browser.get('build/docs/index.html#!/api/ng/directive/input');
2826

29-
// Ensure that the page is loaded before trying to switch frames.
30-
browser.waitForAngular();
27+
// Ensure that the page is loaded before trying to switch frames.
28+
browser.waitForAngular();
3129

32-
browser.switchTo().frame('example-input-directive');
30+
browser.switchTo().frame('example-input-directive');
3331

34-
var nameInput = element(by.model('user.name'));
35-
nameInput.sendKeys('!!!');
32+
var nameInput = element(by.model('user.name'));
33+
nameInput.sendKeys('!!!');
3634

37-
var code = element.all(by.css('tt')).first();
38-
expect(code.getText()).toContain('guest!!!');
39-
});
35+
var code = element.all(by.css('tt')).first();
36+
expect(code.getText()).toContain('guest!!!');
37+
});
4038

41-
it('should trim indentation from code blocks', function() {
42-
browser.get('build/docs/index.html#!/api/ng/type/$rootScope.Scope');
39+
it('should trim indentation from code blocks', function() {
40+
browser.get('build/docs/index.html#!/api/ng/type/$rootScope.Scope');
4341

44-
var codeBlocks = element.all(by.css('pre > code.lang-js'));
45-
codeBlocks.each(function(codeBlock) {
46-
var firstSpan = codeBlock.all(by.css('span')).first();
47-
expect(firstSpan.getText()).not.toMatch(/^\W+$/);
48-
});
42+
var codeBlocks = element.all(by.css('pre > code.lang-js'));
43+
codeBlocks.each(function(codeBlock) {
44+
var firstSpan = codeBlock.all(by.css('span')).first();
45+
expect(firstSpan.getText()).not.toMatch(/^\W+$/);
4946
});
5047
});
5148
});

0 commit comments

Comments
 (0)