mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-01-12 22:45:52 +08:00
@@ -1,6 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
describe('docs.angularjs.org', function () {
|
||||
|
||||
beforeEach(function() {
|
||||
// read and clear logs from previous tests
|
||||
browser.manage().logs().get('browser');
|
||||
});
|
||||
|
||||
|
||||
afterEach(function() {
|
||||
// verify that there were no console errors in the browser
|
||||
browser.manage().logs().get('browser').then(function(browserLog) {
|
||||
expect(browserLog.length).toEqual(0);
|
||||
if (browserLog.length) {
|
||||
console.log('browser console errors: ' + require('util').inspect(browserLog));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('App', function () {
|
||||
// it('should filter the module list when searching', function () {
|
||||
// browser.get();
|
||||
@@ -67,6 +85,12 @@ describe('docs.angularjs.org', function () {
|
||||
browser.get('index-debug.html#!error/ng/areq?p0=Missing&p1=not%20a%20function,%20got%20undefined');
|
||||
expect(element(by.css('.minerr-errmsg')).getText()).toEqual("Argument 'Missing' is not a function, got undefined");
|
||||
});
|
||||
|
||||
|
||||
it("should display links to code on GitHub", function() {
|
||||
browser.get('index-debug.html#!/api/does/not/exist');
|
||||
expect(element(by.css('h1')).getText()).toBe('Oops!');
|
||||
});
|
||||
});
|
||||
|
||||
describe("templates", function() {
|
||||
|
||||
@@ -33,7 +33,7 @@ angular.module('DocsController', [])
|
||||
|
||||
$scope.navClass = function(navItem) {
|
||||
return {
|
||||
active: navItem.href && this.currentPage.path,
|
||||
active: navItem.href && this.currentPage && this.currentPage.path,
|
||||
'nav-index-section': navItem.type === 'section'
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user