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

Commit 0397485

Browse files
committed
wip
1 parent adf2802 commit 0397485

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

test/ng/locationSpec.js

+32-32
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ describe('$location', function() {
305305
});
306306

307307
it('should not rewrite when hashbang url is not given', function() {
308-
initService({html5Mode:true,hashPrefix: '!',supportHistory: true});
308+
initService({html5Mode: true, hashPrefix: '!', supportHistory: true});
309309
inject(
310310
initBrowser({url:'http://domain.com/base/a/b',basePath: '/base'}),
311311
function($rootScope, $location, $browser) {
@@ -556,7 +556,7 @@ describe('$location', function() {
556556

557557
describe('wiring', function() {
558558

559-
beforeEach(initService({html5Mode:false,hashPrefix: '!',supportHistory: true}));
559+
beforeEach(initService({html5Mode: false, hashPrefix: '!', supportHistory: true}));
560560
beforeEach(inject(initBrowser({url:'http://new.com/a/b#!',basePath: 'http://new.com/a/b'})));
561561

562562

@@ -681,7 +681,7 @@ describe('$location', function() {
681681
describe('disabled history', function() {
682682

683683
it('should use hashbang url with hash prefix', function() {
684-
initService({html5Mode:false,hashPrefix: '!'});
684+
initService({html5Mode: false, hashPrefix: '!'});
685685
inject(
686686
initBrowser({url:'http://domain.com/base/index.html#!/a/b',basePath: '/base/index.html'}),
687687
function($rootScope, $location, $browser) {
@@ -696,7 +696,7 @@ describe('$location', function() {
696696

697697

698698
it('should use hashbang url without hash prefix', function() {
699-
initService({html5Mode:false,hashPrefix: ''});
699+
initService({html5Mode: false, hashPrefix: ''});
700700
inject(
701701
initBrowser({url:'http://domain.com/base/index.html#/a/b',basePath: '/base/index.html'}),
702702
function($rootScope, $location, $browser) {
@@ -719,7 +719,7 @@ describe('$location', function() {
719719
}));
720720

721721
it('should use hashbang url with hash prefix', function() {
722-
initService({html5Mode:true,hashPrefix: '!!',supportHistory: false});
722+
initService({html5Mode: true, hashPrefix: '!!', supportHistory: false});
723723
inject(
724724
initBrowser({url:'http://domain.com/base/index.html#!!/a/b',basePath: '/base/index.html'}),
725725
function($rootScope, $location, $browser) {
@@ -734,7 +734,7 @@ describe('$location', function() {
734734

735735

736736
it('should redirect to hashbang url when new url given', function() {
737-
initService({html5Mode:true,hashPrefix: '!'});
737+
initService({html5Mode: true, hashPrefix: '!'});
738738
inject(
739739
initBrowser({url:'http://domain.com/base/new-path/index.html',basePath: '/base/index.html'}),
740740
function($browser, $location) {
@@ -744,7 +744,7 @@ describe('$location', function() {
744744
});
745745

746746
it('should correctly convert html5 url with path matching basepath to hashbang url', function () {
747-
initService({html5Mode:true,hashPrefix: '!',supportHistory: false});
747+
initService({html5Mode: true, hashPrefix: '!', supportHistory: false});
748748
inject(
749749
initBrowser({url:'http://domain.com/base/index.html',basePath: '/base/index.html'}),
750750
function($browser, $location) {
@@ -763,7 +763,7 @@ describe('$location', function() {
763763
}));
764764

765765
it('should use new url', function() {
766-
initService({html5Mode:true,hashPrefix: '',supportHistory: true});
766+
initService({html5Mode: true, hashPrefix: '', supportHistory: true});
767767
inject(
768768
initBrowser({url:'http://domain.com/base/old/index.html#a',basePath: '/base/index.html'}),
769769
function($rootScope, $location, $browser) {
@@ -778,7 +778,7 @@ describe('$location', function() {
778778

779779

780780
it('should rewrite when hashbang url given', function() {
781-
initService({html5Mode:true,hashPrefix: '!',supportHistory: true});
781+
initService({html5Mode: true, hashPrefix: '!', supportHistory: true});
782782
inject(
783783
initBrowser({url:'http://domain.com/base/index.html#!/a/b',basePath: '/base/index.html'}),
784784
function($rootScope, $location, $browser) {
@@ -794,7 +794,7 @@ describe('$location', function() {
794794

795795

796796
it('should rewrite when hashbang url given (without hash prefix)', function() {
797-
initService({html5Mode:true,hashPrefix: '',supportHistory: true});
797+
initService({html5Mode: true, hashPrefix: '', supportHistory: true});
798798
inject(
799799
initBrowser({url:'http://domain.com/base/index.html#/a/b',basePath: '/base/index.html'}),
800800
function($rootScope, $location, $browser) {
@@ -842,7 +842,7 @@ describe('$location', function() {
842842
function configureService(options) {
843843
var linkHref = options.linkHref,
844844
html5Mode = options.html5Mode,
845-
supportHist = options.supportHist,
845+
supportHistory = options.supportHistory,
846846
relLink = options.relLink,
847847
attrs = options.attrs,
848848
content = options.content;
@@ -867,7 +867,7 @@ describe('$location', function() {
867867
link = jqLite('<a ' + attrs + '>' + content + '</a>')[0];
868868
}
869869

870-
$provide.value('$sniffer', {history: supportHist});
870+
$provide.value('$sniffer', {history: supportHistory});
871871
$locationProvider.html5Mode(html5Mode);
872872
$locationProvider.hashPrefix('!');
873873
return function($rootElement, $document) {
@@ -915,7 +915,7 @@ describe('$location', function() {
915915

916916

917917
it('should rewrite rel link to new url when history enabled on new browser', function() {
918-
configureService({linkHref: 'link?a#b', html5Mode: true, supportHist: true});
918+
configureService({linkHref: 'link?a#b', html5Mode: true, supportHistory: true});
919919
inject(
920920
initBrowser(),
921921
initLocation(),
@@ -928,7 +928,7 @@ describe('$location', function() {
928928

929929

930930
it('should do nothing if already on the same URL', function() {
931-
configureService({linkHref: '/base/', html5Mode: true, supportHist: true});
931+
configureService({linkHref: '/base/', html5Mode: true, supportHistory: true});
932932
inject(
933933
initBrowser(),
934934
initLocation(),
@@ -955,7 +955,7 @@ describe('$location', function() {
955955

956956

957957
it('should rewrite abs link to new url when history enabled on new browser', function() {
958-
configureService({linkHref: '/base/link?a#b', html5Mode: true, supportHist: true});
958+
configureService({linkHref: '/base/link?a#b', html5Mode: true, supportHistory: true});
959959
inject(
960960
initBrowser(),
961961
initLocation(),
@@ -968,7 +968,7 @@ describe('$location', function() {
968968

969969

970970
it('should rewrite rel link to hashbang url when history enabled on old browser', function() {
971-
configureService({linkHref: 'link?a#b', html5Mode: true, supportHist: false});
971+
configureService({linkHref: 'link?a#b', html5Mode: true, supportHistory: false});
972972
inject(
973973
initBrowser(),
974974
initLocation(),
@@ -982,7 +982,7 @@ describe('$location', function() {
982982

983983
// Regression (gh-7721)
984984
it('should not throw when clicking anchor with no href attribute when history enabled on old browser', function() {
985-
configureService({linkHref: null, html5Mode: true, supportHist: false});
985+
configureService({linkHref: null, html5Mode: true, supportHistory: false});
986986
inject(
987987
initBrowser(),
988988
initLocation(),
@@ -995,7 +995,7 @@ describe('$location', function() {
995995

996996

997997
it('should produce relative paths correctly when $location.path() is "/" when history enabled on old browser', function() {
998-
configureService({linkHref: 'partial1', html5Mode: true, supportHist: false});
998+
configureService({linkHref: 'partial1', html5Mode: true, supportHistory: false});
999999
inject(
10001000
initBrowser(),
10011001
initLocation(),
@@ -1011,7 +1011,7 @@ describe('$location', function() {
10111011

10121012

10131013
it('should rewrite abs link to hashbang url when history enabled on old browser', function() {
1014-
configureService({linkHref: '/base/link?a#b', html5Mode: true, supportHist: false});
1014+
configureService({linkHref: '/base/link?a#b', html5Mode: true, supportHistory: false});
10151015
inject(
10161016
initBrowser(),
10171017
initLocation(),
@@ -1037,7 +1037,7 @@ describe('$location', function() {
10371037

10381038

10391039
it('should not rewrite links with target="_blank"', function() {
1040-
configureService({linkHref: '/a?b=c', html5Mode: true, supportHist: true, attrs: 'target="_blank"'});
1040+
configureService({linkHref: '/a?b=c', html5Mode: true, supportHistory: true, attrs: 'target="_blank"'});
10411041
inject(
10421042
initBrowser(),
10431043
initLocation(),
@@ -1050,7 +1050,7 @@ describe('$location', function() {
10501050

10511051

10521052
it('should not rewrite links with target specified', function() {
1053-
configureService({linkHref: '/a?b=c', html5Mode: true, supportHist: true, attrs: 'target="some-frame"'});
1053+
configureService({linkHref: '/a?b=c', html5Mode: true, supportHistory: true, attrs: 'target="some-frame"'});
10541054
inject(
10551055
initBrowser(),
10561056
initLocation(),
@@ -1063,7 +1063,7 @@ describe('$location', function() {
10631063

10641064

10651065
it('should not rewrite links with `javascript:` URI', function() {
1066-
configureService({linkHref: ' jAvAsCrIpT:throw new Error("Boom!")', html5Mode: true, supportHist: true, relLink: true});
1066+
configureService({linkHref: ' jAvAsCrIpT:throw new Error("Boom!")', html5Mode: true, supportHistory: true, relLink: true});
10671067
inject(
10681068
initBrowser(),
10691069
initLocation(),
@@ -1076,7 +1076,7 @@ describe('$location', function() {
10761076

10771077

10781078
it('should not rewrite links with `mailto:` URI', function() {
1079-
configureService({linkHref: ' mAiLtO:[email protected]', html5Mode: true, supportHist: true, relLink: true});
1079+
configureService({linkHref: ' mAiLtO:[email protected]', html5Mode: true, supportHistory: true, relLink: true});
10801080
inject(
10811081
initBrowser(),
10821082
initLocation(),
@@ -1102,7 +1102,7 @@ describe('$location', function() {
11021102

11031103

11041104
it('should rewrite when clicked span inside link', function() {
1105-
configureService({linkHref: 'some/link', html5Mode: true, supportHist: true, attrs: '', content: '<span>link</span>'});
1105+
configureService({linkHref: 'some/link', html5Mode: true, supportHistory: true, attrs: '', content: '<span>link</span>'});
11061106
inject(
11071107
initBrowser(),
11081108
initLocation(),
@@ -1118,7 +1118,7 @@ describe('$location', function() {
11181118

11191119
it('should not rewrite when link to different base path when history enabled on new browser',
11201120
function() {
1121-
configureService({linkHref: '/other_base/link', html5Mode: true, supportHist: true});
1121+
configureService({linkHref: '/other_base/link', html5Mode: true, supportHistory: true});
11221122
inject(
11231123
initBrowser(),
11241124
initLocation(),
@@ -1132,7 +1132,7 @@ describe('$location', function() {
11321132

11331133
it('should not rewrite when link to different base path when history enabled on old browser',
11341134
function() {
1135-
configureService({linkHref: '/other_base/link', html5Mode: true, supportHist: false});
1135+
configureService({linkHref: '/other_base/link', html5Mode: true, supportHistory: false});
11361136
inject(
11371137
initBrowser(),
11381138
initLocation(),
@@ -1159,7 +1159,7 @@ describe('$location', function() {
11591159

11601160
it('should not rewrite when full link to different base path when history enabled on new browser',
11611161
function() {
1162-
configureService({linkHref: 'http://host.com/other_base/link', html5Mode: true, supportHist: true});
1162+
configureService({linkHref: 'http://host.com/other_base/link', html5Mode: true, supportHistory: true});
11631163
inject(
11641164
initBrowser(),
11651165
initLocation(),
@@ -1173,7 +1173,7 @@ describe('$location', function() {
11731173

11741174
it('should not rewrite when full link to different base path when history enabled on old browser',
11751175
function() {
1176-
configureService({linkHref: 'http://host.com/other_base/link', html5Mode: true, supportHist: false});
1176+
configureService({linkHref: 'http://host.com/other_base/link', html5Mode: true, supportHistory: false});
11771177
inject(
11781178
initBrowser(),
11791179
initLocation(),
@@ -1198,7 +1198,7 @@ describe('$location', function() {
11981198
});
11991199

12001200
it('should replace current hash fragment when link begins with "#" history disabled', function() {
1201-
configureService({linkHref: '#link', html5Mode: true, supportHist: false, relLink: true});
1201+
configureService({linkHref: '#link', html5Mode: true, supportHistory: false, relLink: true});
12021202
inject(
12031203
initBrowser(),
12041204
initLocation(),
@@ -1215,7 +1215,7 @@ describe('$location', function() {
12151215
});
12161216

12171217
it('should replace current hash fragment when link begins with "#" history enabled', function() {
1218-
configureService({linkHref: '#link', html5Mode: true, supportHist: true, relLink: true});
1218+
configureService({linkHref: '#link', html5Mode: true, supportHistory: true, relLink: true});
12191219
inject(
12201220
initBrowser(),
12211221
initLocation(),
@@ -1235,7 +1235,7 @@ describe('$location', function() {
12351235
if (!msie || msie >= 9) {
12361236

12371237
it('should not rewrite when clicked with ctrl pressed', function() {
1238-
configureService({linkHref: '/a?b=c', html5Mode: true, supportHist: true});
1238+
configureService({linkHref: '/a?b=c', html5Mode: true, supportHistory: true});
12391239
inject(
12401240
initBrowser(),
12411241
initLocation(),
@@ -1248,7 +1248,7 @@ describe('$location', function() {
12481248

12491249

12501250
it('should not rewrite when clicked with meta pressed', function() {
1251-
configureService({linkHref: '/a?b=c', html5Mode: true, supportHist: true});
1251+
configureService({linkHref: '/a?b=c', html5Mode: true, supportHistory: true});
12521252
inject(
12531253
initBrowser(),
12541254
initLocation(),

0 commit comments

Comments
 (0)