Skip to content

Commit 550ba01

Browse files
committed
fix(docs): don't throw exception on the 404 page
Closes angular#8518
1 parent 2294880 commit 550ba01

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

docs/app/e2e/docsAppE2E.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
'use strict';
22

33
describe('docs.angularjs.org', function () {
4+
5+
beforeEach(function() {
6+
// read and clear logs from previous tests
7+
browser.manage().logs().get('browser');
8+
});
9+
10+
11+
afterEach(function() {
12+
// verify that there were no console errors in the browser
13+
browser.manage().logs().get('browser').then(function(browserLog) {
14+
expect(browserLog.length).toEqual(0);
15+
if (browserLog.length) {
16+
console.log('browser console errors: ' + require('util').inspect(browserLog));
17+
}
18+
});
19+
});
20+
21+
422
describe('App', function () {
523
// it('should filter the module list when searching', function () {
624
// browser.get();
@@ -67,6 +85,12 @@ describe('docs.angularjs.org', function () {
6785
browser.get('index-debug.html#!error/ng/areq?p0=Missing&p1=not%20a%20function,%20got%20undefined');
6886
expect(element(by.css('.minerr-errmsg')).getText()).toEqual("Argument 'Missing' is not a function, got undefined");
6987
});
88+
89+
90+
it("should display links to code on GitHub", function() {
91+
browser.get('index-debug.html#!/api/does/not/exist');
92+
expect(element(by.css('h1')).getText()).toBe('Oops!');
93+
});
7094
});
7195

7296
describe("templates", function() {

docs/app/src/docs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ angular.module('DocsController', [])
3333

3434
$scope.navClass = function(navItem) {
3535
return {
36-
active: navItem.href && this.currentPage.path,
36+
active: navItem.href && this.currentPage && this.currentPage.path,
3737
'nav-index-section': navItem.type === 'section'
3838
};
3939
};

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy