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

Commit e81ae14

Browse files
chore(docs): show error 404 without partial failing
We can move the test back into the main describe as it no longer causes an error message to be logged
1 parent de38899 commit e81ae14

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

docs/app/e2e/app.scenario.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,11 @@ describe('docs.angularjs.org', function () {
7676
expect(element(by.css('.minerr-errmsg')).getText()).toEqual("Argument 'Missing' is not a function, got undefined");
7777
});
7878

79+
it("should display an error if the page does not exist", function() {
80+
browser.get('index-debug.html#!/api/does/not/exist');
81+
expect(element(by.css('h1')).getText()).toBe('Oops!');
82+
});
7983

8084
});
8185

82-
});
83-
84-
describe('Error Handling', function() {
85-
it("should display an error if the page does not exist", function() {
86-
browser.get('index-debug.html#!/api/does/not/exist');
87-
expect(element(by.css('h1')).getText()).toBe('Oops!');
88-
});
8986
});

docs/app/src/docs.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,14 @@ angular.module('DocsController', [])
2424
$window._gaq.push(['_trackPageview', pagePath]);
2525
});
2626

27-
$scope.$on('$includeContentError', function() {
28-
$scope.partialPath = 'Error404.html';
29-
});
30-
31-
3227
$scope.$watch(function docsPathWatch() {return $location.path(); }, function docsPathWatchAction(path) {
3328

3429
path = path.replace(/^\/?(.+?)(\/index)?\/?$/, '$1');
3530

36-
$scope.partialPath = 'partials/' + path + '.html';
37-
3831
currentPage = $scope.currentPage = NG_PAGES[path];
3932

4033
if ( currentPage ) {
34+
$scope.partialPath = 'partials/' + path + '.html';
4135
$scope.currentArea = NG_NAVIGATION[currentPage.area];
4236
var pathParts = currentPage.path.split('/');
4337
var breadcrumb = $scope.breadcrumb = [];
@@ -50,6 +44,7 @@ angular.module('DocsController', [])
5044
} else {
5145
$scope.currentArea = NG_NAVIGATION['api'];
5246
$scope.breadcrumb = [];
47+
$scope.partialPath = 'Error404.html';
5348
}
5449
});
5550

0 commit comments

Comments
 (0)