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

Commit e876eec

Browse files
Splaktarmmalerba
authored andcommitted
fix(nav-bar): set ng-href on nav-item even if md-nav-href is empty (#11488)
<!-- Filling out this template is required! Do not delete it when submitting a Pull Request! Without this information, your Pull Request may be auto-closed. --> ## PR Checklist Please check that your PR fulfills the following requirements: - [x] The commit message follows [our guidelines](https://github.com/angular/material/blob/master/.github/CONTRIBUTING.md#-commit-message-format) - [x] Tests for the changes have been added or this is not a bug fix / enhancement - [x] Docs have been added, updated, or were not required ## PR Type What kind of change does this PR introduce? <!-- Please check the one that applies to this PR using "x". --> ``` [x] Bugfix [ ] Enhancement [ ] Documentation content changes [ ] Code style update (formatting, local variables) [ ] Refactoring (no functional changes, no api changes) [ ] Build related changes [ ] CI related changes [ ] Infrastructure changes [ ] Other... Please describe: ``` ## What is the current behavior? - A new `npm i` may pick up `[email protected]` which will cause many test failures since we don't currently support that version. - Setting `md-nav-href=""` on an `md-nav-item` doesn't apply the proper `ng-href=""` because of a bad `if` check. - The docs indicate that a navigation attribute **must** be defined on each `md-nav-item`, but the code doesn't throw an exception if this occurs. This can lead to unexpected behaviors like infinite loops or hanging async tasks. - The Closure properties are incorrect in a number of cases. <!-- Please describe the current behavior that you are modifying and link to one or more relevant issues. --> Issue Number: Relates to #11485. Relates to #11486. Fixes #11487. ## What is the new behavior? - set ng-href on nav-item even if md-nav-href is empty - fix closure properties to better represent the existing code - pin the version of jasmine-core since we don't support 2.99.1 yet - slightly improve the tone of the exceptions - pull in some karma configuration tweaks from Angular Material ## Does this PR introduce a breaking change? ``` [ ] Yes [x] No ``` <!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. --> <!-- Note that breaking changes are highly unlikely to get merged to master unless the validation is clear and the use case is critical. --> ## Other information
1 parent 841e8b2 commit e876eec

File tree

7 files changed

+104
-59
lines changed

7 files changed

+104
-59
lines changed

config/karma-sauce.conf.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ module.exports = function(config) {
4242
}
4343
},
4444

45-
singleRun: true
45+
singleRun: true,
46+
autoWatch: false
4647
});
4748

4849
};

config/karma-travis.conf.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ module.exports = function(config) {
66
// Override defaults with custom CI settings
77
config.set({
88
colors: false,
9+
singleRun: true,
10+
autoWatch: false,
911

1012
browsers: ['ChromeHeadlessNoSandbox', 'FirefoxHeadless'],
1113
customLaunchers: {

config/karma.conf.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,17 @@ module.exports = function(config) {
4949
plugins: [
5050
require("karma-jasmine"),
5151
require("karma-chrome-launcher"),
52-
require('karma-firefox-launcher')
52+
require('karma-firefox-launcher'),
53+
require('karma-browserstack-launcher'),
54+
require('karma-sauce-launcher')
5355
],
5456
frameworks: ['jasmine'],
5557
files: dependencies.concat(testSrc),
5658

57-
browserDisconnectTimeout: 500,
59+
browserDisconnectTimeout: 10000,
60+
browserDisconnectTolerance: 3,
61+
browserNoActivityTimeout: 10000,
62+
captureTimeout: 10000,
5863

5964
logLevel: config.LOG_DEBUG,
6065
port: 9876,
@@ -63,8 +68,16 @@ module.exports = function(config) {
6368

6469
// Continuous Integration mode
6570
// enable / disable watching file and executing tests whenever any file changes
66-
singleRun: true,
67-
autoWatch: false,
71+
singleRun: false,
72+
autoWatch: true,
73+
74+
// Try Websocket for a faster transmission first. Fallback to polling if necessary.
75+
transports: ['websocket', 'polling'],
76+
77+
browserConsoleLogOptions: {
78+
terminal: true,
79+
level: 'log'
80+
},
6881

6982
// Start these browsers, currently available:
7083
// - Chrome
@@ -78,7 +91,7 @@ module.exports = function(config) {
7891

7992
client: {
8093
// Do not clear the context as this can cause reload failures with Jasmine
81-
clearContext:false
94+
clearContext: false
8295
}
8396
});
8497
};

package-lock.json

Lines changed: 40 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"gulp-sass": "^4.0.1",
7272
"gulp-uglify": "^3.0.0",
7373
"gulp-util": "^3.0.8",
74-
"jasmine-core": "^2.2.0",
74+
"jasmine-core": "2.8.0",
7575
"jquery": "^3.3.1",
7676
"jshint": "^2.9.5",
7777
"jshint-summary": "^0.4.0",

0 commit comments

Comments
 (0)