@@ -258,8 +258,6 @@ describe('$anchorScroll', function() {
258
258
} ;
259
259
}
260
260
261
- beforeEach ( inject ( setupBodyForOffsetTesting ( ) ) ) ;
262
-
263
261
afterEach ( inject ( function ( $document ) {
264
262
dealoc ( $document ) ;
265
263
} ) ) ;
@@ -269,18 +267,17 @@ describe('$anchorScroll', function() {
269
267
270
268
var yOffsetNumber = 50 ;
271
269
272
- beforeEach ( inject (
273
- setupBodyForOffsetTesting ( ) ,
274
- setYOffset ( yOffsetNumber ) ) ) ;
275
-
276
-
277
270
it ( 'should scroll with vertical offset' , inject (
271
+ setupBodyForOffsetTesting ( ) ,
272
+ setYOffset ( yOffsetNumber ) ,
278
273
addElements ( 'id=some' ) ,
279
274
changeHashTo ( 'some' ) ,
280
275
expectScrollingWithOffset ( 'id=some' , yOffsetNumber ) ) ) ;
281
276
282
277
283
278
it ( 'should use the correct vertical offset when changing `yOffset` at runtime' , inject (
279
+ setupBodyForOffsetTesting ( ) ,
280
+ setYOffset ( yOffsetNumber ) ,
284
281
addElements ( 'id=some' ) ,
285
282
changeHashTo ( 'some' ) ,
286
283
setYOffset ( yOffsetNumber - 10 ) ,
@@ -293,6 +290,8 @@ describe('$anchorScroll', function() {
293
290
var targetAdjustedOffset = 25 ;
294
291
295
292
inject (
293
+ setupBodyForOffsetTesting ( ) ,
294
+ setYOffset ( yOffsetNumber ) ,
296
295
addElements ( 'id=some1' , 'id=some2' ) ,
297
296
function ( $window ) {
298
297
// Make sure the elements are just a little shorter than the viewport height
@@ -334,6 +333,7 @@ describe('$anchorScroll', function() {
334
333
}
335
334
336
335
inject (
336
+ setupBodyForOffsetTesting ( ) ,
337
337
addElements ( 'id=id1' , 'name=name2' ) ,
338
338
setYOffset ( yOffsetFunction ) ,
339
339
changeHashTo ( 'id1' ) ,
@@ -371,6 +371,7 @@ describe('$anchorScroll', function() {
371
371
372
372
373
373
it ( 'should scroll with vertical offset when `top === 0`' , inject (
374
+ setupBodyForOffsetTesting ( ) ,
374
375
createAndSetYOffsetElement ( {
375
376
background : 'DarkOrchid' ,
376
377
height : '50px' ,
@@ -383,6 +384,7 @@ describe('$anchorScroll', function() {
383
384
384
385
385
386
it ( 'should scroll with vertical offset when `top > 0`' , inject (
387
+ setupBodyForOffsetTesting ( ) ,
386
388
createAndSetYOffsetElement ( {
387
389
height : '50px' ,
388
390
position : 'fixed' ,
@@ -394,6 +396,7 @@ describe('$anchorScroll', function() {
394
396
395
397
396
398
it ( 'should scroll without vertical offset when `position !== fixed`' , inject (
399
+ setupBodyForOffsetTesting ( ) ,
397
400
createAndSetYOffsetElement ( {
398
401
height : '50px' ,
399
402
position : 'absolute' ,
0 commit comments